caolan/nodeunit — Issue #123: setUp no longer works with nested testCases
Author: BryanDonovan
Created: 2011-10-29 23:12:38+00:00
State: open

Something in 0.6.0 caused the below test to no longer work. A nested testCase apparently doesn't run setUp anymore. I see that testCase is sort of deprecated, but what's the replacement?

```
var testCase = require('nodeunit').testCase;
var setup_flag = 'foo';

module.exports = testCase({
setUp: function(callback) {
setup_flag = 'bar';
callback();
},

/*
// Uncommenting this test makes nested-test C (below) pass
"top-level-test": function(test) {
test.equal(setup_flag, 'bar');
test.done();
},
*/
/*
// Uncommenting this test makes nested-test C pass
"TC A": testCase({
"nested-test A": function(test) {
test.equal(setup_flag, 'bar');
test.done();
}
}),
*/

"TC B": testCase({
"TC C": testCase({
"nested-test C": function(test) {
// this fails
test.equal(setup_flag, 'bar');
test.done();
}
})
})
});
```