In my React front end project, jest library is used for unit test cases. I am trying to run the front-end unit test cases from build pipeline. To do that, I am planning to add a new task in the task group. The task
npm run test
executes the unit test cases which are related to the recent changes. When I run the same command from the VS Code terminal, it is asking to press "a" to run all the test cases. Even if I run the below command with "--watchAll"
npm run test --watchAll
*No tests found related to files changed since last commit.
Press a to run all tests, or run Jest with --watchAll.
*
But I am planning to run all the test cases every time the pipeline is being executed. What would be the command to achieve that?
I tried goggling for the solution but not found anything concrete.
The default of
jestcommand is run all tests, but looks like your test files are not following the convention:Jest will look for test files with any of the following popular naming conventions:
__tests__folders.Checkout CRA documentation for more detail