|
1 | | -'use strict'; |
2 | | -const common = require('../common'); |
| 1 | +import { skipIfInspectorDisabled } from '../common/index.mjs'; |
3 | 2 |
|
4 | | -common.skipIfInspectorDisabled(); |
| 3 | +skipIfInspectorDisabled(); |
5 | 4 |
|
6 | | -const fixtures = require('../common/fixtures'); |
7 | | -const startCLI = require('../common/debugger'); |
| 5 | +import * as fixtures from '../common/fixtures.mjs'; |
| 6 | +import startCLI from '../common/debugger.js'; |
8 | 7 |
|
9 | | -const assert = require('assert'); |
10 | | -const { spawn } = require('child_process'); |
| 8 | +import assert from 'assert'; |
| 9 | +import { spawn } from 'child_process'; |
11 | 10 |
|
12 | 11 | // NOTE(oyyd): We might want to import this regexp from "lib/_inspect.js"? |
13 | 12 | const kDebuggerMsgReg = /Debugger listening on ws:\/\/\[?(.+?)\]?:(\d+)\//; |
@@ -53,22 +52,20 @@ function launchTarget(...args) { |
53 | 52 | assert.ifError(error); |
54 | 53 | } |
55 | 54 |
|
56 | | - (async () => { |
57 | | - try { |
58 | | - const { childProc, host, port } = await launchTarget('--inspect=0', script); |
59 | | - target = childProc; |
60 | | - cli = startCLI([`${host || '127.0.0.1'}:${port}`]); |
61 | | - await cli.waitForPrompt(); |
62 | | - await cli.command('sb("alive.js", 3)'); |
63 | | - await cli.waitFor(/break/); |
64 | | - await cli.waitForPrompt(); |
65 | | - assert.match( |
66 | | - cli.output, |
67 | | - /> 3 {3}\+\+x;/, |
68 | | - 'marks the 3rd line' |
69 | | - ); |
70 | | - } finally { |
71 | | - cleanup(); |
72 | | - } |
73 | | - })().then(common.mustCall()); |
| 55 | + try { |
| 56 | + const { childProc, host, port } = await launchTarget('--inspect=0', script); |
| 57 | + target = childProc; |
| 58 | + cli = startCLI([`${host || '127.0.0.1'}:${port}`]); |
| 59 | + await cli.waitForPrompt(); |
| 60 | + await cli.command('sb("alive.js", 3)'); |
| 61 | + await cli.waitFor(/break/); |
| 62 | + await cli.waitForPrompt(); |
| 63 | + assert.match( |
| 64 | + cli.output, |
| 65 | + /> 3 {3}\+\+x;/, |
| 66 | + 'marks the 3rd line' |
| 67 | + ); |
| 68 | + } finally { |
| 69 | + cleanup(); |
| 70 | + } |
74 | 71 | } |
0 commit comments