1'use strict'; 2const common = require('../common'); 3const async_hooks = require('async_hooks'); 4 5if (!common.isMainThread) 6 common.skip('Worker bootstrapping works differently -> different AsyncWraps'); 7 8const hook = async_hooks.createHook({ 9 init: common.mustCall(2), 10 before: common.mustCall(1), 11 after: common.mustNotCall() 12}).enable(); 13 14Promise.resolve(1).then(common.mustCall(() => { 15 hook.disable(); 16 17 Promise.resolve(42).then(common.mustCall()); 18 19 process.nextTick(common.mustCall()); 20})); 21