mirror of https://github.com/lukechilds/node.git
Browse Source
Combine and rename tests for the `beforeExit` event on `process`. The naming now more closely follows the de facto conventions of the project. The two tests were very similar and do not seem to benefit from being separate. PR-URL: https://github.com/nodejs/node/pull/10581 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>v6
Rich Trott
8 years ago
2 changed files with 14 additions and 15 deletions
@ -1,14 +0,0 @@ |
|||
'use strict'; |
|||
require('../common'); |
|||
const assert = require('assert'); |
|||
|
|||
var N = 5; |
|||
var n = 0; |
|||
|
|||
function f() { |
|||
if (++n < N) setTimeout(f, 5); |
|||
} |
|||
process.on('beforeExit', f); |
|||
process.on('exit', function() { |
|||
assert.equal(n, N + 1); // The sixth time we let it through.
|
|||
}); |
Loading…
Reference in new issue