Skip to content

Commit

Permalink
test: remove timers test from test-handle-wrap-isrefed.js
Browse files Browse the repository at this point in the history
Since this doesn't work:
process.binding('timer_wrap');
  • Loading branch information
RaisinTen committed Feb 10, 2021
1 parent 08ef35c commit 8bdd85b
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions test/parallel/test-handle-wrap-isrefed.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
const common = require('../common');
const strictEqual = require('assert').strictEqual;
const { internalBinding } = require('internal/test/binding');
const { getActiveResources } = require('async_hooks');

// child_process
{
Expand Down Expand Up @@ -108,25 +107,4 @@ const { kStateSymbol } = require('internal/dgram');
}


// timers
{
const { Timer } = process.binding('timer_wrap');
strictEqual(Object.values(getActiveResources()).filter(
(handle) => (handle instanceof Timer)).length, 0);
const timer = setTimeout(() => {}, 500);
const handles = Object.values(getActiveResources()).filter(
(handle) => (handle instanceof Timer));
strictEqual(handles.length, 1);
const handle = handles[0];
strictEqual(Object.getPrototypeOf(handle).hasOwnProperty('hasRef'),
true, 'timer_wrap: hasRef() missing');
strictEqual(handle.hasRef(), true);
timer.unref();
strictEqual(handle.hasRef(),
false, 'timer_wrap: unref() ineffective');
timer.ref();
strictEqual(handle.hasRef(),
true, 'timer_wrap: ref() ineffective');
}

// See also test/pseudo-tty/test-handle-wrap-isrefed-tty.js

0 comments on commit 8bdd85b

Please sign in to comment.