busterjs/buster — Issue #107: setUp of deferred tests are executed
Author: jodal
Created: 2012-02-24 13:17:44+00:00
State: open

setUp of deferred tests are executed, which means that errors in the test setUp method are repeated for tests you didn't expect to be executed, adding more identical error messages.

Given the following setup:

``` javascript
// buster.js

var config = module.exports;

config['My tests'] = {
environment: 'browser',
tests: ['*-test.js']
};

// setup_of_deferred_tests_is_executed-test.js

buster.testCase('a test case', {
setUp: function() {
this_will_fail()
},

'test that should be executed': function() {
},

'//test that should not be executed': function() {
}
});
```

We get the following test results:

```
$ buster test
Firefox 11.0 Linux: EE
Error: Firefox 11.0 Linux a test case test that should be executed
ReferenceError: this_will_fail is not defined
()@./setup_of_deferred_tests_is_executed-test.js:5

Error: Firefox 11.0 Linux a test case test that should not be executed
ReferenceError: this_will_fail is not defined
()@./setup_of_deferred_tests_is_executed-test.js:5

1 test case, 2 tests, 0 assertions, 0 failures, 2 errors, 0 timeouts
WARNING: No assertions!
```