xref: /third_party/node/test/parallel/test-timers-dispose.js (revision 1cb0ef41)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
1'use strict';
2const common = require('../common');
3const assert = require('assert');
4
5const timer = setTimeout(common.mustNotCall(), 10);
6const interval = setInterval(common.mustNotCall(), 10);
7const immediate = setImmediate(common.mustNotCall());
8
9timer[Symbol.dispose]();
10interval[Symbol.dispose]();
11immediate[Symbol.dispose]();
12
13
14process.on('exit', () => {
15  assert.strictEqual(timer._destroyed, true);
16  assert.strictEqual(interval._destroyed, true);
17  assert.strictEqual(immediate._destroyed, true);
18});
19

Indexes created Thu Nov 07 10:32:03 CST 2024