Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixup: improve test
  • Loading branch information
Trott committed Oct 6, 2015
commit 42712930c71a3f70feeb26d28336f6a49e0e8530
9 changes: 7 additions & 2 deletions test/parallel/test-timers-active.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ var legitTimers = [
];

legitTimers.forEach(function(legit) {
const savedTimeout = legit._idleTimeout;
active(legit);
// active() should mutate these objects
assert.notDeepEqual(Object.keys(legit), ['_idleTimeout']);
assert(legit._idleTimeout === savedTimeout);
assert(Number.isInteger(legit._idleStart));
assert(legit._idleNext);
assert(legit._idlePrev);
});


Expand All @@ -22,7 +26,8 @@ var bogusTimers = [
];

bogusTimers.forEach(function(bogus) {
const savedTimeout = bogus._idleTimeout;
active(bogus);
// active() should not mutate these objects
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: these?

assert.deepEqual(Object.keys(bogus), ['_idleTimeout']);
assert.deepStrictEqual(bogus, {_idleTimeout: savedTimeout});
});