| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,22 +15,19 @@ const path = require('path'); | |||
| 15 | 15 | const script = path.relative(process.cwd(), scriptFullPath); | |
| 16 | 16 | const cli = startCLI([script]); | |
| 17 | 17 | ||
| 18 | - function onFatal(error) { | ||
| 19 | - cli.quit(); | ||
| 20 | - throw error; | ||
| 21 | - } | ||
| 22 | - | ||
| 23 | - return cli.waitForInitialBreak() | ||
| 24 | - .then(() => cli.waitForPrompt()) | ||
| 25 | - .then(() => cli.stepCommand('c')) | ||
| 26 | - .then(() => cli.command('bt')) | ||
| 27 | - .then(() => { | ||
| 18 | + async function runTest() { | ||
| 19 | + try { | ||
| 20 | + await cli.waitForInitialBreak(); | ||
| 21 | + await cli.waitForPrompt(); | ||
| 22 | + await cli.stepCommand('c'); | ||
| 23 | + await cli.command('bt'); | ||
| 28 | 24 | assert.ok(cli.output.includes(`#0 topFn ${script}:7:2`)); | |
| 29 | - }) | ||
| 30 | - .then(() => cli.command('backtrace')) | ||
| 31 | - .then(() => { | ||
| 25 | + await cli.command('backtrace'); | ||
| 32 | 26 | assert.ok(cli.output.includes(`#0 topFn ${script}:7:2`)); | |
| 33 | - }) | ||
| 34 | - .then(() => cli.quit()) | ||
| 35 | - .then(null, onFatal); | ||
| 27 | + } finally { | ||
| 28 | + await cli.quit(); | ||
| 29 | + } | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + runTest(); | ||
| 36 | 33 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments