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

Commit 27d4bea

Browse files
test: fix of Windows and MacOS (#14698)
1 parent eed313f commit 27d4bea

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

packages/browsers/test/src/CLI.spec.ts

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -108,25 +108,26 @@ describe('CLI', function () {
108108
`chrome@${testChromeBuildId}`,
109109
`--path=${tmpDir}`,
110110
`--base-url=${getServerUrl()}`,
111-
'--format={{browser}} {{buildId}} {{path}}',
111+
'--format={{path}}@{{buildId}}@{{browser}}',
112112
]);
113113
} finally {
114114
console.log = originalLog;
115115
}
116116

117-
const found = logs.some(log => {
118-
return (
119-
log ===
120-
`chrome ${testChromeBuildId} ${path.join(
121-
tmpDir,
122-
'chrome',
123-
os.platform() === 'linux' ? `linux-${testChromeBuildId}` : '',
124-
'chrome-linux64',
125-
'chrome',
126-
)}`
127-
);
128-
});
129-
130-
assert(found, `Expected output not found in logs: ${JSON.stringify(logs)}`);
117+
const found = logs
118+
.find(log => {
119+
return log.includes('chrome');
120+
})
121+
?.split('@');
122+
123+
assert(found, `No match found in ${JSON.stringify(logs)}`);
124+
125+
assert(found[0]?.startsWith(tmpDir), `Expected path to include tmpdir`);
126+
assert.strictEqual(
127+
found[1],
128+
testChromeBuildId,
129+
'Expected buildId to match',
130+
);
131+
assert.strictEqual(found[2], 'chrome', 'Expected browser to match');
131132
});
132133
});

0 commit comments

Comments
 (0)