Jest: cli argument to prevent snapshot recording during CI

Created on 25 Mar 2017  路  4Comments  路  Source: facebook/jest

Do you want to request a feature or report a bug?

feature

What is the current behavior?

I can't ensure that all snapshots were recorded before running test in CI.
Unrecorded snapshots will be written on the CI server fs and the test suite will pass.

What is the expected behavior?

I can ensure that the test will fail if it tries to create a new snapshot.

--recordSnapshot    Records snapshots.
                    Useful to disable when you want
                    to make sure all snapshot are already recoded (e.g: on CI)
                    Disable using --no-recordSnapshot.
                    [boolean] [default: true]
Feature Request

Most helpful comment

We should simply detect if "CI" is present. If it is, don't offer to write snapshots initially unless -u is specified. This should be the default. Happy to receive PRs for this :)

All 4 comments

This is quite interesting

We should simply detect if "CI" is present. If it is, don't offer to write snapshots initially unless -u is specified. This should be the default. Happy to receive PRs for this :)

there's a other things that are different on CI,
we should just have --ci flag that adds these defaults

This'll be in Jest 20. See #3456.

Was this page helpful?
0 / 5 - 0 ratings