运行 通过使用 grep 进行过滤进行的测试不起作用
Running tests by filtering with grep not working
我有以下测试:
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"'
我看了一下这个问题https://github.com/DevExpress/testcafe/issues/4615
看起来 npx 在正则表达式解析和 -T 参数方面存在问题。
我执行了 node_modules\.bin\testcafe --test-grep '111|222'
并且成功了!
我有以下测试:
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"'
我看了一下这个问题https://github.com/DevExpress/testcafe/issues/4615 看起来 npx 在正则表达式解析和 -T 参数方面存在问题。
我执行了 node_modules\.bin\testcafe --test-grep '111|222'
并且成功了!