summaryrefslogtreecommitdiff
path: root/test/parallel/test-async-hooks-enable-during-promise.js
blob: 17b3c884bb9284c11df5b894a6dc45841b687a6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'use strict';
const common = require('../common');
const async_hooks = require('async_hooks');

common.crashOnUnhandledRejection();

Promise.resolve(1).then(common.mustCall(() => {
  async_hooks.createHook({
    init: common.mustCall(),
    before: common.mustCall(),
    after: common.mustCall(2)
  }).enable();

  process.nextTick(common.mustCall());
}));