admin管理员组文章数量:1332706
Honestly, jest
of facebook has a bad document.
I want to use jest -t xxx
to update my snapshots.
Here is my test, but no one works correctly.
jest -u -t='test.tsx'
jest -u -t 'test.tsx'
jest -u -t /test.tsx/
jest -u -t=/test.tsx/
I want to match and update snapshots test files which filename pattern like *.test.tsx
.
How can I do that with jest testNamePattern
?
Honestly, jest
of facebook has a bad document.
I want to use jest -t xxx
to update my snapshots.
Here is my test, but no one works correctly.
jest -u -t='test.tsx'
jest -u -t 'test.tsx'
jest -u -t /test.tsx/
jest -u -t=/test.tsx/
I want to match and update snapshots test files which filename pattern like *.test.tsx
.
How can I do that with jest testNamePattern
?
-
have you tried
jest -u -t '*.test.tsx'
? – JoeTidee Commented Jul 24, 2017 at 11:18
1 Answer
Reset to default 9First check jest --showConfig to see that you even have the option of --testNamePattern. I faced the same issue, and did not find this option in jest config.
So I changed my directory structure and used --testPathPattern option with regex. This works.
jest --testPathPattern='(tests)/spec/./snapshot-tests/.'
本文标签: javascripthow to use testNamePattern of jest within packagejson scripts fieldStack Overflow
版权声明:本文标题:javascript - how to use testNamePattern of jest within package.json scripts field? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742260214a2442372.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论