-
Notifications
You must be signed in to change notification settings - Fork 30.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: changing promises to async/await
- Loading branch information
1 parent
5d92ddc
commit 0256f38
Showing
2 changed files
with
35 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { skipIfInspectorDisabled } from '../common/index.mjs'; | ||
skipIfInspectorDisabled(); | ||
|
||
import { path } from '../common/fixtures.mjs'; | ||
import startCLI from '../common/debugger.js'; | ||
|
||
import assert from 'assert'; | ||
const script = path('debugger', 'three-lines.js'); | ||
const cli = startCLI([script]); | ||
try { | ||
await cli.waitForInitialBreak(); | ||
await cli.waitForPrompt(); | ||
assert.match(cli.output, /debug>/, 'prints a prompt'); | ||
assert.match( | ||
cli.output, | ||
/< Debugger listening on [^\n]*9229/, | ||
'forwards child output' | ||
); | ||
await cli.command('["hello", "world"].join(" ")'); | ||
assert.match(cli.output, /hello world/, 'prints the result'); | ||
await cli.command(''); | ||
assert.match( | ||
cli.output, | ||
/hello world/, | ||
'repeats the last command on <enter>' | ||
); | ||
await cli.command('version'); | ||
assert.ok( | ||
cli.output.includes(process.versions.v8), | ||
'version prints the v8 version' | ||
); | ||
} finally { | ||
const code = await cli.quit(); | ||
assert.strictEqual(code, 0); | ||
} |