diff --git a/.mocharc.cjs b/.mocharc.cjs index d2b798bcce7..8414501ced2 100644 --- a/.mocharc.cjs +++ b/.mocharc.cjs @@ -14,6 +14,10 @@ * limitations under the License. */ +let timeout = process.platform === 'win32' ? 20_000 : 10_000; +if (!!process.env.DEBUGGER_ATTACHED) { + timeout = 0; +} module.exports = { reporter: 'dot', logLevel: 'debug', @@ -22,6 +26,6 @@ module.exports = { exit: !!process.env.CI, retries: process.env.CI ? 3 : 0, parallel: !!process.env.PARALLEL, - timeout: process.platform === 'win32' ? 20_000 : 10_000, + timeout: timeout, reporter: process.env.CI ? 'spec' : 'dot', }; diff --git a/.vscode/launch.template.json b/.vscode/launch.template.json index cdd05181beb..4fe7e1945a5 100644 --- a/.vscode/launch.template.json +++ b/.vscode/launch.template.json @@ -37,7 +37,10 @@ "--no-coverage", "--no-suggestions" ], - "outFiles": ["${workspaceFolder}/**/*.js"] + "outFiles": ["${workspaceFolder}/**/*.js"], + "env": { + "DEBUGGER_ATTACHED": true + } } ] } diff --git a/test/src/network.spec.ts b/test/src/network.spec.ts index 65403c9b653..02f9782a269 100644 --- a/test/src/network.spec.ts +++ b/test/src/network.spec.ts @@ -819,7 +819,9 @@ describe('network', function () { }); const [response] = await Promise.all([ - waitEvent(page, 'response'), + waitEvent(page, 'response', res => { + return !isFavicon(res); + }), page.evaluate(() => { const xhr = new XMLHttpRequest(); xhr.open('GET', '/foo');