davidchambers/tutor — pull request #2 by njay (2012-04-03 19:24:44+00:00)
Title: Switch to using Mocha for tests

In addition, move card and set fixtures into spec/fixtures/cards.coffee and spec/fixtures/sets.coffee

When I was first working on the project, I tried a bunch of different test frameworks, including mocha, but I couldn't get any unmet expectation exceptions to be noticed, so I moved on. The problem was that they were being called inside the jsdom.env callback, which (reasonably) doesn't bubble up exceptions by default. The solution is to wrap the callback in process.nextTick, as you can see in the parser diff.

The first line of mocha.opts sets a timeout of 3 seconds for each test, which is ridiculous. As I've mentioned, my next test-focused branch will be to mock out the requests and make separate parser tests with gatherer page fixtures, so the suite will run much faster, and not require an internet connection.