On 6/3/2014 8:39 AM, Gijs Kruitbosch wrote:
On 03/06/2014 14:16, Mike de Boer wrote:
Indeed, I’m used to the NodeJS/ Mocha flow of writing tests as fast, or even faster, as writing the implementation of a feature. I could group tests, isolate one, hook in a debugger at any point and more. This is something I miss while working on Fx and to be honest: I still crave for more than a year later.


So I'm not used to the "NodeJS/Mocha" 'flow' of writing tests. Can you explain what the big difference there is? I find it hard to believe the names of the assertion functions are the one big thing making tests take much longer to write...

I'm used to xpcshell tests more than mochitests, and the biggest difference by far between xpcshell and mocha that I'm aware of is that mocha counts tests at finer granularity: xpcshell tests work on a file-by-file basis, whereas mocha tests work at the level of individual test('Name', function() {}) calls. With the right framework support, this makes it much easier to debug and diagnose single failures when you're testing a parser function, since you can enable and test only a single instance instead of setting a breakpoint and continue'ing twelve times to get to the one you want [fwiw, I have 822 tests in just 6 files for one of my suites, although most of those are defined in giant array comparisons].

--
Joshua Cranmer
Thunderbird and DXR developer
Source code archæologist

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to