Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions test/parallel/test-timers-clearImmediate.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
'use strict';
require('../common');
const assert = require('assert');
const common = require('../common');

const N = 3;
let count = 0;

function next() {
const immediate = setImmediate(function() {
clearImmediate(immediate);
++count;
});
const immediate = setImmediate(
common.mustCall(() => clearImmediate(immediate))
);
Copy link
Contributor

@Fishrock123 Fishrock123 Apr 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this indentation off?

}
for (let i = 0; i < N; ++i)
next();

process.on('exit', () => {
assert.strictEqual(count, N, `Expected ${N} immediate callback executions`);
});
for (let i = 0; i < N; i++) {
next();
}