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/.'