Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsamyuktaprabhu <samyuktaprabhu@gmail.com>2022-09-16 21:33:56 +0300
committerDanielle Adams <adamzdanielle@gmail.com>2022-10-05 13:54:16 +0300
commit117f068250de4425d4b2134f9132be2bf1d6dc07 (patch)
treecc1be5abc09f6a50641e4ec3847631161f63e098 /test
parentb27b336a7a2a62a2612bfc97a7333f6f94b63d66 (diff)
test: use async/await in test-debugger-auto-resume
PR-URL: https://github.com/nodejs/node/pull/44675 Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/sequential/test-debugger-auto-resume.js36
-rw-r--r--test/sequential/test-debugger-auto-resume.mjs35
2 files changed, 35 insertions, 36 deletions
diff --git a/test/sequential/test-debugger-auto-resume.js b/test/sequential/test-debugger-auto-resume.js
deleted file mode 100644
index 8a25f5fc804..00000000000
--- a/test/sequential/test-debugger-auto-resume.js
+++ /dev/null
@@ -1,36 +0,0 @@
-'use strict';
-const common = require('../common');
-
-common.skipIfInspectorDisabled();
-
-const fixtures = require('../common/fixtures');
-const startCLI = require('../common/debugger');
-const { addLibraryPath } = require('../common/shared-lib-util');
-
-const assert = require('assert');
-const path = require('path');
-
-addLibraryPath(process.env);
-
-// Auto-resume on start if the environment variable is defined.
-{
- const scriptFullPath = fixtures.path('debugger', 'break.js');
- const script = path.relative(process.cwd(), scriptFullPath);
-
- const env = { ...process.env };
- env.NODE_INSPECT_RESUME_ON_START = '1';
-
- const cli = startCLI([script], [], { env });
-
- cli.waitForInitialBreak()
- .then(() => {
- assert.deepStrictEqual(
- cli.breakInfo,
- { filename: script, line: 10 },
- );
- })
- .then(() => cli.quit())
- .then((code) => {
- assert.strictEqual(code, 0);
- });
-}
diff --git a/test/sequential/test-debugger-auto-resume.mjs b/test/sequential/test-debugger-auto-resume.mjs
new file mode 100644
index 00000000000..e2f18d6e2bc
--- /dev/null
+++ b/test/sequential/test-debugger-auto-resume.mjs
@@ -0,0 +1,35 @@
+import { skipIfInspectorDisabled } from '../common/index.mjs';
+
+skipIfInspectorDisabled();
+
+import { path as _path } from '../common/fixtures.js';
+import startCLI from '../common/debugger.js';
+import { addLibraryPath } from '../common/shared-lib-util.js';
+
+import { deepStrictEqual, strictEqual } from 'assert';
+import { relative } from 'path';
+
+addLibraryPath(process.env);
+
+// Auto-resume on start if the environment variable is defined.
+{
+ const scriptFullPath = _path('debugger', 'break.js');
+ const script = relative(process.cwd(), scriptFullPath);
+
+ const env = {
+ ...process.env,
+ };
+ env.NODE_INSPECT_RESUME_ON_START = '1';
+
+ const cli = startCLI([script], [], {
+ env,
+ });
+
+ await cli.waitForInitialBreak();
+ deepStrictEqual(cli.breakInfo, {
+ filename: script,
+ line: 10,
+ });
+ const code = await cli.quit();
+ strictEqual(code, 0);
+}