summaryrefslogtreecommitdiff
path: root/test/parallel/test-timer-close.js
blob: 158b082cf3167a6574491b8703062ae2cd2c4102 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use strict';
require('../common');
const assert = require('assert');

const t = new (process.binding('timer_wrap').Timer)();
let called = 0;
function onclose() {
  called++;
}

t.close(onclose);
t.close(onclose);

process.on('exit', function() {
  assert.equal(1, called);
});