Tests, closures and arrow functions

Imagine a Mocha test file like this spec.js 12345 describe(‘my tests’, function () { it(‘works’, function () { // everything works fine })}) The single test named “works” is synchronous; it passes 1 $ cat package.json { “name”: “test-closures”, “version”: “1.0.0”, “description”: “”, “main”: “index.js”, “scripts”: { “test”: “mocha spec.js” }, “keywords”: [], “author”: “”, […]

Continue reading


Rocha and Focha

I love Mocha and usually recommend it as a very easy to learn and flexible unit testing framework. Lately, I have created two wrappers that extend Mocha with additional useful features: test order randomization and running previously failed unit tests first. I released these tools as NPM packages rocha and focha. Randomize test order Look […]

Continue reading