aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-async-hooks-enable-recursive.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-async-hooks-enable-recursive.js')
-rw-r--r--test/parallel/test-async-hooks-enable-recursive.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/parallel/test-async-hooks-enable-recursive.js b/test/parallel/test-async-hooks-enable-recursive.js
new file mode 100644
index 0000000000..bcb0dcc0ce
--- /dev/null
+++ b/test/parallel/test-async-hooks-enable-recursive.js
@@ -0,0 +1,19 @@
+'use strict';
+
+const common = require('../common');
+const async_hooks = require('async_hooks');
+const fs = require('fs');
+
+const nestedHook = async_hooks.createHook({
+ init: common.mustCall()
+});
+
+async_hooks.createHook({
+ init: common.mustCall((id, type) => {
+ nestedHook.enable();
+ }, 2)
+}).enable();
+
+fs.access(__filename, common.mustCall(() => {
+ fs.access(__filename, common.mustCall());
+}));