2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2015-12-23 16:02:12 -08:00
|
|
|
require('../common');
|
2013-10-07 15:39:39 +02:00
|
|
|
var 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.
|
|
|
|
});
|