• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2const common = require('../common');
3const assert = require('assert');
4const async_hooks = require('async_hooks');
5
6const hook = async_hooks.createHook({
7  init: common.mustCall(() => {}, 1),
8  before: common.mustNotCall(),
9  after: common.mustNotCall(),
10  destroy: common.mustNotCall()
11});
12
13assert.strictEqual(hook.enable(), hook);
14assert.strictEqual(hook.enable(), hook);
15
16setImmediate(common.mustCall());
17
18assert.strictEqual(hook.disable(), hook);
19assert.strictEqual(hook.disable(), hook);
20assert.strictEqual(hook.disable(), hook);
21