lundi 13 août 2018

How can I use --changedSince and --onlyChanged in jest?

I want to use changedSince and onlyChanged flag for jest. I changed lots of tests and also files that the tests depends on. And according to the documentation of jest cli flags:

changedSince: Runs tests related the changes since the provided branch. If the current branch has diverged from the given branch, then only changes made locally will be tested.

onlyChanged: Alias -o. Attempts to identify which tests to run based on which files have changed in the current repository. Only works if you're running tests in a git/hg repository at the moment and requires a static dependency graph (ie. no dynamic requires).

But when I run jest --changedSince=master or jest --onlyChanged it runs 0 tests without giving anything in the terminal at all.

jest --listTests lists all the tests. However when I run jest --listTests --changedSince=master or jest --listTests --onlyChanged, it lists no test.

Aucun commentaire:

Enregistrer un commentaire