| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5bed2d1 commit a7666ab
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,24 +16,22 @@ const startCLI = require('../common/debugger'); | |||
| 16 | 16 | const script = fixtures.path('debugger', 'three-lines.js'); | |
| 17 | 17 | const cli = startCLI([script]); | |
| 18 | 18 | ||
| 19 | - function onFatal(error) { | ||
| 20 | - cli.quit(); | ||
| 21 | - throw error; | ||
| 22 | - } | ||
| 23 | - | ||
| 24 | 19 | const listeningRegExp = /Debugger listening on/g; | |
| 25 | 20 | ||
| 26 | - cli.waitForInitialBreak() | ||
| 27 | - .then(() => cli.waitForPrompt()) | ||
| 28 | - .then(() => { | ||
| 21 | + async function onWaitForInitialBreak() { | ||
| 22 | + try { | ||
| 23 | + await cli.waitForInitialBreak(); | ||
| 24 | + await cli.waitForPrompt(); | ||
| 29 | 25 | assert.strictEqual(cli.output.match(listeningRegExp).length, 1); | |
| 30 | - }) | ||
| 31 | - .then(async () => { | ||
| 26 | + | ||
| 32 | 27 | for (let i = 0; i < RESTARTS; i++) { | |
| 33 | 28 | await cli.stepCommand('restart'); | |
| 34 | 29 | assert.strictEqual(cli.output.match(listeningRegExp).length, 1); | |
| 35 | 30 | } | |
| 36 | - }) | ||
| 37 | - .then(() => cli.quit()) | ||
| 38 | - .then(null, onFatal); | ||
| 31 | + } finally { | ||
| 32 | + await cli.quit(); | ||
| 33 | + } | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + onWaitForInitialBreak(); | ||
| 39 | 37 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments