This is how we’ll roll from now

Example tdd with Gender component

Very short update this time.

On the left, we’ve got Karma our test runner, running Jasmine the unit test framework with the help of airbnb/enzyme to provide shallow render components and trigger browser based events.

On the right, we have the top which is just meteor running a local server, and the bottom is the karma running watching for changes in the tests directory. I’ve just added the third test which is why it’s failing and once I’m done with the blog post, I’m going to make it work!

To allow me to write tests in ES6, Karma actually has a bit of webpack inside it which pre-processes the test files by concatenating them together and using babel to transpile them into the one file which is then picked up by Karma as a ES5 file.

Super excited at the moment! This will mark my 5th attempt into unit testing and 2nd into TDD over the last 10 years, I have a good feeling about this one ^_^.

This post is going to be as technical as it gets, once I finish off the tests for the existing code, we can get back to the shop inventory!!!