我在 jest/js 中有很多测试。 我想从运行中排除其中一些带有标签 @bug 的代码。
从运行中排除的测试示例:
test("@bug Sign In - Check Wrong user credentials: status-code 400", async () => { ... });
我尝试运行这个脚本:
npx jest --testNamePattern='^(?!.*@bug).*$'
但它运行所有测试,并且不排除带有标签@bug的测试。
有人遇到过这样的行为吗?
可以尝试使用 testpathIgnorePatterns 代替。将使正则表达式更容易https://jestjs.io/docs/configuration#testpathignorepatterns-arraystring