| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,28 +12,24 @@ const assert = require('assert'); | |||
| 12 | 12 | const cli = startCLI([fixtures.path('debugger/three-lines.js')]); | |
| 13 | 13 | const scriptPattern = /^\* (\d+): \S+debugger(?:\/|\\)three-lines\.js/m; | |
| 14 | 14 | ||
| 15 | - function onFatal(error) { | ||
| 16 | - cli.quit(); | ||
| 17 | - throw error; | ||
| 18 | - } | ||
| 19 | - | ||
| 20 | - return cli.waitForInitialBreak() | ||
| 21 | - .then(() => cli.waitForPrompt()) | ||
| 22 | - .then(() => cli.command('scripts')) | ||
| 23 | - .then(() => { | ||
| 15 | + async function testDebuggerLowLevel() { | ||
| 16 | + try { | ||
| 17 | + await cli.waitForInitialBreak(); | ||
| 18 | + await cli.waitForPrompt(); | ||
| 19 | + await cli.command('scripts'); | ||
| 24 | 20 | const [, scriptId] = cli.output.match(scriptPattern); | |
| 25 | - return cli.command( | ||
| 21 | + await cli.command( | ||
| 26 | 22 | `Debugger.getScriptSource({ scriptId: '${scriptId}' })` | |
| 27 | 23 | ); | |
| 28 | - }) | ||
| 29 | - .then(() => { | ||
| 30 | 24 | assert.match( | |
| 31 | 25 | cli.output, | |
| 32 | 26 | /scriptSource:[ \n]*'(?:\(function \(|let x = 1)/); | |
| 33 | 27 | assert.match( | |
| 34 | 28 | cli.output, | |
| 35 | 29 | /let x = 1;/); | |
| 36 | - }) | ||
| 37 | - .then(() => cli.quit()) | ||
| 38 | - .then(null, onFatal); | ||
| 30 | + } finally { | ||
| 31 | + await cli.quit(); | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + testDebuggerLowLevel(); | ||
| 39 | 35 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments