| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,36 @@ | |||
| 1 | + import { skipIfInspectorDisabled } from '../common/index.mjs'; | ||
| 2 | + skipIfInspectorDisabled(); | ||
| 3 | + | ||
| 4 | + import { path } from '../common/fixtures.mjs'; | ||
| 5 | + import startCLI from '../common/debugger.js'; | ||
| 6 | + | ||
| 7 | + import assert from 'assert'; | ||
| 8 | + | ||
| 9 | + const script = path('debugger', 'three-lines.js'); | ||
| 10 | + const cli = startCLI([script]); | ||
| 11 | + try { | ||
| 12 | + await cli.waitForInitialBreak(); | ||
| 13 | + await cli.waitForPrompt(); | ||
| 14 | + assert.match(cli.output, /debug>/, 'prints a prompt'); | ||
| 15 | + assert.match( | ||
| 16 | + cli.output, | ||
| 17 | + /< Debugger listening on [^\n]*9229/, | ||
| 18 | + 'forwards child output' | ||
| 19 | + ); | ||
| 20 | + await cli.command('["hello", "world"].join(" ")'); | ||
| 21 | + assert.match(cli.output, /hello world/, 'prints the result'); | ||
| 22 | + await cli.command(''); | ||
| 23 | + assert.match( | ||
| 24 | + cli.output, | ||
| 25 | + /hello world/, | ||
| 26 | + 'repeats the last command on <enter>' | ||
| 27 | + ); | ||
| 28 | + await cli.command('version'); | ||
| 29 | + assert.ok( | ||
| 30 | + cli.output.includes(process.versions.v8), | ||
| 31 | + 'version prints the v8 version' | ||
| 32 | + ); | ||
| 33 | + } finally { | ||
| 34 | + const code = await cli.quit(); | ||
| 35 | + assert.strictEqual(code, 0); | ||
| 36 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments