-
-
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.
do not exit when only unref'd timer is present in test code; closes #…
…3817 Signed-off-by: Christopher Hiller <[email protected]>
- Loading branch information
Showing
3 changed files
with
32 additions
and
10 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
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,3 @@ | ||
it('unrefs a timeout', function(done) { | ||
setTimeout(done, 10).unref(); | ||
}); |
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,19 @@ | ||
'use strict'; | ||
|
||
var helpers = require('../helpers'); | ||
var runMochaJSON = helpers.runMochaJSON; | ||
|
||
describe('--timeout', function() { | ||
var args = []; | ||
|
||
it("should complete tests having unref'd async behavior", function(done) { | ||
args = ['--timeout', '0']; | ||
runMochaJSON('options/timeout-unref', args, function(err, res) { | ||
if (err) { | ||
return done(err); | ||
} | ||
expect(res, 'to have passed').and('to have passed test count', 1); | ||
done(); | ||
}); | ||
}); | ||
}); |