| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a8533ac commit 0753bc1
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -73,6 +73,7 @@ function runScenario(scriptName, throwsOnLine, next) { | |||
| 73 | 73 | client.connect(port); | |
| 74 | 74 | } | |
| 75 | 75 | ||
| 76 | + let interval; | ||
| 76 | 77 | function runTest(client) { | |
| 77 | 78 | client.req( | |
| 78 | 79 | { | |
@@ -91,20 +92,22 @@ function runScenario(scriptName, throwsOnLine, next) { | |||
| 91 | 92 | ||
| 92 | 93 | client.reqContinue(function(error) { | |
| 93 | 94 | assert.ifError(error); | |
| 94 | - setTimeout(assertHasPaused.bind(null, client), 100); | ||
| 95 | + interval = setInterval(assertHasPaused.bind(null, client), 10); | ||
| 95 | 96 | }); | |
| 96 | 97 | } | |
| 97 | 98 | ); | |
| 98 | 99 | } | |
| 99 | 100 | ||
| 100 | 101 | function assertHasPaused(client) { | |
| 101 | - assert(exceptions.length, 'no exceptions thrown, race condition in test?'); | ||
| 102 | + if (!exceptions.length) return; | ||
| 103 | + | ||
| 102 | 104 | assert.strictEqual(exceptions.length, 1, | |
| 103 | 105 | 'debugger did not pause on exception'); | |
| 104 | 106 | assert.strictEqual(exceptions[0].uncaught, true); | |
| 105 | 107 | assert.strictEqual(exceptions[0].script.name, testScript); | |
| 106 | 108 | assert.strictEqual(exceptions[0].sourceLine + 1, throwsOnLine); | |
| 107 | 109 | asserted = true; | |
| 108 | 110 | client.reqContinue(assert.ifError); | |
| 111 | + clearInterval(interval); | ||
| 109 | 112 | } | |
| 110 | 113 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments