-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Runner.prototype.uncaught: don't double-end runnables that already ha…
…ve a state. Fixes #1327 Closes #1335 Signed-off-by: Joshua Appelman <[email protected]>
- Loading branch information
Showing
6 changed files
with
53 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ coverage.html | |
lib-cov | ||
.DS_Store | ||
node_modules | ||
test-outputs | ||
*.sock | ||
testing | ||
_mocha.js | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
var debug = require('debug')('mocha:issue1327'); | ||
it("test 1", function() { | ||
debug("This runs only once."); | ||
process.nextTick(function() { | ||
throw "Too bad"; | ||
}); | ||
}); | ||
it("test 2", function() { | ||
debug("This should run once - Previously wasn't called at all."); | ||
}); | ||
it("test 3", function() { | ||
debug("This used to run twice."); | ||
throw new Error("OUCH"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
var assert = require("assert"), | ||
fs = require("fs"); | ||
|
||
describe("GitHub issue #1327: expected behavior of case.js", function() { | ||
it("should have run 3 tests", function() { | ||
var results = JSON.parse(fs.readFileSync( | ||
"test-outputs/issue1327/case-out.json")); | ||
results.stats.tests.should.equal(3); | ||
}); | ||
}); |