Reputation: 8460
Currently I am testing a React node application, and have all my tests in the root/tests folder, with components in separate folders pertaining to their function.
I have 10+ folders and 100+ tests, and would like to 'watch' a single folder while I write a test for a new component.
Currently, I am using
npm run test:watch
Which is working brilliantly, however, not only is there a lot of overhead re-running the 100 other tests not related to my new component, it's also hard to weed through all the feedback to see the results of my current test.
Is there a nice command to only watch the directory of my new test, or even the test file?
Upvotes: 2
Views: 15874
Reputation: 51881
You can pass mocha test directory to the npm command:
npm run test:watch -- root/tests/subfolder
However it might depend on how your test script test:watch
is defined.
Upvotes: 5