summaryrefslogtreecommitdiff
path: root/test/parallel/test-timers-unref-leak.js
blob: afecf7f15ce1b523d87b9afc3e324cb26bc39a4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
'use strict';
const common = require('../common');

const timeout = setTimeout(common.mustCall(), 10);
timeout.unref();

// Wrap `close` method to check if the handle was closed
const close = timeout._handle.close;
timeout._handle.close = common.mustCall(function() {
  return close.apply(this, arguments);
});

// Just to keep process alive and let previous timer's handle die
setTimeout(() => {}, 50);