Skip to content

Commit 4915cac

Browse files
Merge pull request #24 from NativeScript/vladimirov/fix-double-restart
Do not schedule execution in case `--watch` is not set
2 parents 71d762b + 7f08fd1 commit 4915cac

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ function NativeScriptLauncher(baseBrowserDecorator, logger, config, args, emitte
3838

3939
self.markCaptured();
4040

41-
executor.schedule();
41+
// In case --watch is passed to CLI, each change in file should restart the tests.
42+
// When a new browser is registered, in case `singleRun` is false (that's when --watch is not passed)
43+
// tests should be scheduled.
44+
// When `singleRun` is true, karma automatically runs the tests when browser is registered,
45+
// so do not schedule them in this case.
46+
if(launcherConfig.options.watch) {
47+
executor.schedule();
48+
}
4249
});
4350

4451
function logDebugOutput(data) {

0 commit comments

Comments
 (0)