豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit a2950e2

Browse files
authored
test: deflake network test (#994)
drive-by: switch to dot reporter locally and make it configurable
1 parent c9691c6 commit a2950e2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

scripts/test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const nodeArgs = [
5050
'./build/tests/setup.js',
5151
'--no-warnings=ExperimentalWarning',
5252
'--test-reporter',
53-
'spec',
53+
(process.env['NODE_TEST_REPORTER'] ?? process.env['CI']) ? 'spec' : 'dot',
5454
'--test-force-exit',
5555
'--test',
5656
'--test-timeout=60000',

tests/tools/network.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ describe('network', () => {
105105
await withMcpContext(async (response, context) => {
106106
await context.setUpNetworkCollectorForTesting();
107107
const page = context.getSelectedPage();
108-
await page.goto(server.getRoute('/redirect'));
108+
await page.goto(server.getRoute('/redirect'), {
109+
waitUntil: 'networkidle0',
110+
});
109111
await listNetworkRequests.handler(
110112
{
111113
params: {

0 commit comments

Comments
 (0)