node/test/parallel/test-async-hooks-enable-during-promise.js
Andy Chen bce5cba43e
test: add common.crashOnUnhandledRejection()
added to test-async-hooks-enable-during-promise.js

PR-URL: https://github.com/nodejs/node/pull/17234
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-11-26 15:47:10 +09:00

16 lines
358 B
JavaScript

'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());
}));