Reputation: 1028
I use karma as test runner for my Javascript test with enabled autoWatch option. Every time a test file changes karma reruns the tests, how expected. But when I create a new test file karma does not detect this file automatically until I restart karma manually, although the new file matches the watched file pattern in the karma configuration.
How karma has to be configured in order to detect new test files automatically?
Upvotes: 0
Views: 454
Reputation: 400
Karma config is loaded only at startup. So you need to wrap karma in some other runner.
For example: you can use gulp
.
gulp.watch
can... watch for file changes and rerun karma from scratch (in order to reload the config).
For further details about implementation you could take a look at this: gulp-karma
Upvotes: 1