Skip to content

restartOnFileChange doesn't work after run completes normally #1640

@scottohara

Description

@scottohara

I just upgraded to 0.13.11 and tried the restartOnFileChange option out for the first time.

An excerpt from my karma.conf.js is:

  autoWatch: true,
  singleRun: false,
  restartOnFileChange: true
}

When I kick off a test run, and then quickly edit/save a watched file; I see that the current run is cancelled and a new run starts, as per the docs.

I can repeat this process any number of times; with the same results each time (current run is cancelled, new run starts).

However, if I let the current run continue all the way through to completion; then make a change to a watched file, a new run will start, but it doesn't run any tests.

Example console output is below. It shows:

  1. the end of a successful run (Finished in 39.126 secs, 1325 tests completed)
  2. a change detected in the file foo.js
  3. another run triggered, but with 0 tests completed:
Finished in 39.136 secs / 1.009 secs

SUMMARY:
✔ 1325 tests completed
19 10 2015 16:42:45.754:INFO [watcher]: Changed file "foo.js".

Finished in 0.002 secs / 0 secs

SUMMARY:
✔ 0 tests completed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions