我有以下测试:
test('111', async t => {
await t.expect(true).ok()
});
test('222', async t => {
await t.expect(true).ok()
});
我想使用-T , --test-grep模式运行两个测试,但是在Powershell中执行时出现错误:
npx testcafe -T "111|222"
'222' is not recognized as an internal or external command, operable program or batch file.
为什么会这样?我确定我使用的是正确的正则表达式模式。另外我也不想使用测试metadata过滤。
在这种情况下,似乎TestCafe参数解析器无法正确解析grep字符串。请用单引号将grep
参数包裹起来,如下所示:
testcafe chrome test.js -T '"111|222"'