| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,20 +8,17 @@ const fixtures = require('../common/fixtures'); | |||
| 8 | 8 | const startCLI = require('../common/debugger'); | |
| 9 | 9 | ||
| 10 | 10 | // Test for "Breakpoint at specified location already exists" error. | |
| 11 | - { | ||
| 12 | - const script = fixtures.path('debugger', 'three-lines.js'); | ||
| 13 | - const cli = startCLI([script]); | ||
| 11 | + const script = fixtures.path('debugger', 'three-lines.js'); | ||
| 12 | + const cli = startCLI([script]); | ||
| 14 | 13 | ||
| 15 | - function onFatal(error) { | ||
| 16 | - cli.quit(); | ||
| 17 | - throw error; | ||
| 14 | + (async () => { | ||
| 15 | + try { | ||
| 16 | + await cli.waitForInitialBreak(); | ||
| 17 | + await cli.waitForPrompt(); | ||
| 18 | + await cli.command('setBreakpoint(1)'); | ||
| 19 | + await cli.command('setBreakpoint(1)'); | ||
| 20 | + await cli.waitFor(/Breakpoint at specified location already exists/); | ||
| 21 | + } finally { | ||
| 22 | + await cli.quit(); | ||
| 18 | 23 | } | |
| 19 | - | ||
| 20 | - cli.waitForInitialBreak() | ||
| 21 | - .then(() => cli.waitForPrompt()) | ||
| 22 | - .then(() => cli.command('setBreakpoint(1)')) | ||
| 23 | - .then(() => cli.command('setBreakpoint(1)')) | ||
| 24 | - .then(() => cli.waitFor(/Breakpoint at specified location already exists/)) | ||
| 25 | - .then(() => cli.quit()) | ||
| 26 | - .then(null, onFatal); | ||
| 27 | - } | ||
| 24 | + })().then(common.mustCall()); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments