☕️ Classic, reliable, trusted test framework for Node.js and the browser
utilize new "error" event
Tj Holowaychukfff4926a8ab0
diff --git a/lib/runner.js b/lib/runner.jsindex 3f929ff1..35df5e27 100644--- a/lib/runner.js+++ b/lib/runner.js@@ -249,13 +249,8 @@ Runner.prototype.runTest = function(fn){, self = this;try {- test.run(function(err){- if (test.finished) {- if (!test.failed) self.fail(test, new Error('done() called multiple times'));- return;- }- fn(err);- });+ test.on('error', function(err){ self.fail(test, err); });+ test.run(fn);} catch (err) {fn(err);}diff --git a/test.js b/test.jsindex 0b080d5a..48e6a484 100644--- a/test.js+++ b/test.js@@ -1,13 +1,16 @@describe('something', function(){- beforeEach(function(done){- done()- done()- done()- })+ // beforeEach(function(done){+ // done()+ // done()+ // done()+ // })it('should work', function(done){- // done(new Error('test'));+ done();+ done();+ done();+ done();done();})})\ No newline at end of file