开玩笑:我试图忽略所有以.stories.tsx
例如SomeFileName.stories.tsx
. 添加到 my package.json
->*.stories.tsx
中,如下coveragePathIgnorePatterns
所示jest
:
"jest": {\n "coveragePathIgnorePatterns": [\n ...\n "*.stories.tsx"\n ]\n}\n
Run Code Online (Sandbox Code Playgroud)\n不幸的是,运行测试将为我的所有测试抛出以下错误:
\n\n\n\xe2\x97\x8f 测试套件运行失败
\nRun Code Online (Sandbox Code Playgroud)\nSyntaxError: Invalid regular expression: /*.stories.tsx/: Nothing to repeat\n at String.match (<anonymous>)\n ...\n
我需要在里面添加什么才能coveragePathIgnorePatterns
使其工作?
根据评论:通过添加"<rootDir>/.*.stories.tsx$"
我的解决方案package.json
"jest": {
"coveragePathIgnorePatterns": [
...
"<rootDir>/.*.stories.tsx$"
]
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3172 次 |
最近记录: |