| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 32877d9 commit 3210653
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ const assert = require('assert'); | |||
| 5 | 5 | const spawn = require('child_process').spawn; | |
| 6 | 6 | const debug = require('_debugger'); | |
| 7 | 7 | ||
| 8 | - var scenarios = []; | ||
| 8 | + const scenarios = []; | ||
| 9 | 9 | ||
| 10 | 10 | addScenario('global.js', 2); | |
| 11 | 11 | addScenario('timeout.js', 2); | |
@@ -21,34 +21,33 @@ function addScenario(scriptName, throwsOnLine) { | |||
| 21 | 21 | } | |
| 22 | 22 | ||
| 23 | 23 | function run() { | |
| 24 | - var next = scenarios.shift(); | ||
| 24 | + const next = scenarios.shift(); | ||
| 25 | 25 | if (next) next(); | |
| 26 | 26 | } | |
| 27 | 27 | ||
| 28 | 28 | function runScenario(scriptName, throwsOnLine, next) { | |
| 29 | - console.log('**[ %s ]**', scriptName); | ||
| 30 | - var asserted = false; | ||
| 31 | - var port = common.PORT; | ||
| 29 | + let asserted = false; | ||
| 30 | + const port = common.PORT; | ||
| 32 | 31 | ||
| 33 | - var testScript = path.join( | ||
| 32 | + const testScript = path.join( | ||
| 34 | 33 | common.fixturesDir, | |
| 35 | 34 | 'uncaught-exceptions', | |
| 36 | 35 | scriptName | |
| 37 | 36 | ); | |
| 38 | 37 | ||
| 39 | - var child = spawn(process.execPath, [ '--debug-brk=' + port, testScript ]); | ||
| 38 | + const child = spawn(process.execPath, [ '--debug-brk=' + port, testScript ]); | ||
| 40 | 39 | child.on('close', function() { | |
| 41 | 40 | assert(asserted, 'debugger did not pause on exception'); | |
| 42 | 41 | if (next) next(); | |
| 43 | 42 | }); | |
| 44 | 43 | ||
| 45 | - var exceptions = []; | ||
| 44 | + const exceptions = []; | ||
| 46 | 45 | ||
| 47 | - var stderr = ''; | ||
| 46 | + let stderr = ''; | ||
| 48 | 47 | ||
| 49 | 48 | function stderrListener(data) { | |
| 50 | 49 | stderr += data; | |
| 51 | - if (stderr.includes('Debugger listening on port')) { | ||
| 50 | + if (stderr.includes('Debugger listening on ')) { | ||
| 52 | 51 | setTimeout(setupClient.bind(null, runTest), 200); | |
| 53 | 52 | child.stderr.removeListener('data', stderrListener); | |
| 54 | 53 | } | |
@@ -58,7 +57,7 @@ function runScenario(scriptName, throwsOnLine, next) { | |||
| 58 | 57 | child.stderr.on('data', stderrListener); | |
| 59 | 58 | ||
| 60 | 59 | function setupClient(callback) { | |
| 61 | - var client = new debug.Client(); | ||
| 60 | + const client = new debug.Client(); | ||
| 62 | 61 | ||
| 63 | 62 | client.once('ready', callback.bind(null, client)); | |
| 64 | 63 | ||
@@ -83,14 +82,14 @@ function runScenario(scriptName, throwsOnLine, next) { | |||
| 83 | 82 | enabled: true | |
| 84 | 83 | } | |
| 85 | 84 | }, | |
| 86 | - function(error, result) { | ||
| 85 | + function(error) { | ||
| 87 | 86 | assert.ifError(error); | |
| 88 | 87 | ||
| 89 | 88 | client.on('exception', function(event) { | |
| 90 | 89 | exceptions.push(event.body); | |
| 91 | 90 | }); | |
| 92 | 91 | ||
| 93 | - client.reqContinue(function(error, result) { | ||
| 92 | + client.reqContinue(function(error) { | ||
| 94 | 93 | assert.ifError(error); | |
| 95 | 94 | setTimeout(assertHasPaused.bind(null, client), 100); | |
| 96 | 95 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments