I see. I was not sure if doY() depends on doX(). I don't know if there is a solution for defining parallelization "chunks", the usual advice is to redesign your tests so that they are both small (single assert) and independent. It means each test has to recreate the environment (possibly run doX() again). Considering the effort required, it may be better to stay with your original code (one test with multiple asserts) for now.
Mocha is still the most popular framework. It is extensible, you can write your own test reporter that will include stack trace in the output.
What you can do:
- Start your own test reporter by copying the code of the mocha reporter you like to use/fix. See [1] for an example of a third-party reporter and how to use it in your project.
- Once you have a working version, back-port your changes to the original mocha reporter and submit a pull request.
To answer your question - another popular test library is tap [2].
===
I wrote a simple test case to reproduce your problem. It seems the problem is in the algorithm for printing nice diff output when the AssertionError includes information about the expected and the actual values.
Variant A:
var expect = require('chai').expect;
describe('foo', function() {
it('should bar', function() {
expect(false).to.equal(true);
});
});
Output:
1) foo should bar:
+ expected - actual
+true
-false
Variant B:
var assert = require('assert');
describe('foo', function() {
it('should bar', function() {
assert.equal(true, false);
});
});
Output:
1) foo should bar:
AssertionError: true == false
at Context.<anonymous> (/private/tmp/asd/test.js:5:12)
at Test.Runnable.run (/usr/local/lib/node_modules/mocha/lib/runnable.js:211:32)
[cut]
This is related to an existing issue [2] that I have reported recently, I'll update the description to mention your use case too.