Skip to content

Add watch option to test script

Paul Gascou-Vaillancourt requested to merge test-script-watch into master

What does this MR do?

This adds a -w/--watch flag to the unified test script. When enabled, Jest receives the --watch flag and Karma receives --single-run false --auto-watch, allowing both test runners to watch for files changes and re-run tests when needed. It's worth noting that tests are run in parallel when watch mode is enabled, otherwise the first test runner would hang while waiting for files changes, preventing the other runner from ever booting up.

How to use it?

Run the script as usual, just add that sweet -w flag:

yarn test app/assets/javascripts/registry -w

Does this MR meet the acceptance criteria?

Conformity

Edited by Paul Gascou-Vaillancourt

Merge request reports