common.js contains code that checks for variables leaking into the global namespace. Load common.js in all tests that do not intentionally leak variables. PR-URL: https://github.com/nodejs/node/pull/3095 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
20 lines
390 B
JavaScript
20 lines
390 B
JavaScript
'use strict';
|
|
/*
|
|
* This test is a regression test for joyent/node#8900.
|
|
*/
|
|
require('../common');
|
|
var assert = require('assert');
|
|
|
|
var N = 5;
|
|
var nbIntervalFired = 0;
|
|
var timer = setInterval(function() {
|
|
++nbIntervalFired;
|
|
if (nbIntervalFired === N)
|
|
clearInterval(timer);
|
|
}, 1);
|
|
|
|
timer.unref();
|
|
|
|
setTimeout(function onTimeout() {
|
|
assert.strictEqual(nbIntervalFired, N);
|
|
}, 100);
|