summaryrefslogtreecommitdiff
path: root/test/sequential/test-resolution-inspect-brk.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/sequential/test-resolution-inspect-brk.js')
-rw-r--r--test/sequential/test-resolution-inspect-brk.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/sequential/test-resolution-inspect-brk.js b/test/sequential/test-resolution-inspect-brk.js
new file mode 100644
index 0000000000..2af32426c0
--- /dev/null
+++ b/test/sequential/test-resolution-inspect-brk.js
@@ -0,0 +1,29 @@
+'use strict';
+const common = require('../common');
+common.skipIfInspectorDisabled();
+
+// A test to ensure that preload modules are given a chance to execute before
+// resolving the main entry point with --inspect-brk active.
+
+const assert = require('assert');
+const cp = require('child_process');
+const path = require('path');
+
+function test(execArgv) {
+ const child = cp.spawn(process.execPath, execArgv);
+
+ child.stderr.once('data', common.mustCall(function() {
+ child.kill('SIGTERM');
+ }));
+
+ child.on('exit', common.mustCall(function(code, signal) {
+ assert.strictEqual(signal, 'SIGTERM');
+ }));
+}
+
+test([
+ '--require',
+ path.join(__dirname, '../fixtures/test-resolution-inspect-brk-resolver.js'),
+ '--inspect-brk',
+ '../fixtures/test-resolution-inspect-resolver-main.ext',
+]);