Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: remove redundant code from timers.js #3143

Closed
wants to merge 3 commits into from
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

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 42712930c71a3f70feeb26d28336f6a49e0e8530
9 changes: 7 additions & 2 deletions test/parallel/test-timers-active.js
Original file line number Diff line number Diff line change
@@ -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);
});


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

bogusTimers.forEach(function(bogus) {
const savedTimeout = bogus._idleTimeout;
active(bogus);
// active() should not mutate these objects
Copy link
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});
});