bit
bit copied to clipboard
How to update jest snapshots
Hello, We are using Bit + Jest to test our components. Creating a snapshot works fine on the first run. However, we are not sure how to run it with the -u flag.
I've tried to do bit test -path-to-component -- -u
, but it doesn't seem to be forwarding the flag to jest.
Can you advise? In addition, is there a way to have setupTests file that we can use to configure jest? I don't see this documented.
Thank you!
Facing same issue, not able to update snapshots
same issue too, is there a schedule to resolve this?
This still needs to be resolved, but I did find a workaround. You can run bit test -w
to run jest in watch mode, then press u
to update the failing snapshots (or i for interactive)
Watch Usage
› Press f to run only failed tests.
› Press o to only run tests related to changed files.
› Press p to filter by a filename regex pattern.
› Press t to filter by a test name regex pattern.
› Press u to update failing snapshots.
› Press i to update failing snapshots interactively.
› Press q to quit watch mode.
› Press Enter to trigger a test run.