karma-runner/karma-nodeunit — pull request #10 by alexstrat (2013-11-18 23:10:40+00:00)
Title: Bugfix: support set up tear down

While trying to use *karma-nodeunit* in a project, I got the feeling that `setUp` and `tearDown` did not work properly (they were considered as test-cases). Empirically, I knew that *nodeunit* lib was buggy: changing `nodeunit.js` by a more recent build fixed the issue.

So, in *karma-nodeunit*:

I modified the tests of karma-nodeunit to make it use `setUp` and `tearDown` in d0b2dc2. As, predicted it failed with a fairly explicit message:

```sh
.
PhantomJS 1.9.2 (Mac OS X) nodeunit adapter running a suite of tests should report test results FAILED
Error: expected 'setUp' to equal 'Ceci nes\'t pas une test' (/Users/alex/Code/karma-nodeunit/node_modules/expect.js/expect.js:99)
PhantomJS 1.9.2 (Mac OS X) nodeunit adapter running a suite of tests should report test results FAILED
Error: expected 'setUp' to equal 'Ceci nes\'t pas une test' (/Users/alex/Code/karma-nodeunit/node_modules/expect.js/expect.js:99)
..
```

Then I replaced current *nodeunit* build with a more recent one in edebd88. But things began to go weird: tests failed.

```sh
.
PhantomJS 1.9.2 (Mac OS X) nodeunit adapter running a suite of tests should report test results FAILED
Error: expected false to equal true (/Users/alex/Code/karma-nodeunit/node_modules/expect.js/expect.js:99)
PhantomJS 1.9.2 (Mac OS X) nodeunit adapter running a suite of tests should report test results FAILED
Error: expected false to equal true (/Users/alex/Code/karma-nodeunit/node_modules/expect.js/expect.js:99)
..
```

This is saying that the "passing" fixture test-case actually does not pass.

And indeed doing:

```diff
--- a/test/adapter.spec.js
+++ b/test/adapter.spec.js
@@ -32,7 +32,7 @@ describe('nodeunit adapter ', function() {
sinon.stub(tc, 'result', function(result) {
expect(result.description).to.equal("Ceci nes't pas une test");
expect(result.suite).to.be.an('array');
- expect(result.success).to.be(true);
+ expect(result.success).to.be(false);
expect(result.log).to.be.an('array');
});
runSuite(fixtureSuite.passing, function() {
```

makes test pass.

So, to be sure that this fixture test-case was really failing, I tried to make run "normally" with `nodeunit` in NodeJS and in browse (I commited my test utility stuff in eb54d09): the fixture test-case is perfectly succeeding!

So, my guess is: whether there is a bug in adapter, wether there is a bug in its test suite. Could you help please ?