-
Notifications
You must be signed in to change notification settings - Fork 12k
ng test does not react properly when detecting a code change #13542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@FrancescoBorzi thank you for testing this on the latest version again. I agree with you that this behaviour is a bug because the previous run should be interrupted. |
There is an karma configuration option for this: and this is what it does in if (config.autoWatch) {
this.on('file_list_modified', () => {
this.log.debug('List of files has changed, trying to execute')
if (config.restartOnFileChange) {
socketServer.sockets.emit('stop')
}
executor.schedule()
})
} @FrancescoBorzi could you check if this option works for you? should I do a PR to include this in |
@confraria thanks, it looks like it's working. However there is a small defect (after putting some it says "Executed X tests of null` so it doesn't say the total amount of tests that are there. |
@confraria yes that definitely sounds like we should use as a default. Can you make a PR please? @FrancescoBorzi does it go back to saying the right total after the first run, or does it always say null now? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
As requested by @filipesilva, I tested this issue again on a newer CLI version: #9901
The result is that the bug is exactly the same as before. As described in the original issue.
I post here my new
ng --version
as well as the (same) description of the bug.Versions
Repro steps
fdescribe
orfit
)Observed behavior
It will recompile (or at least it looks like it) but it will still keep continuing the previous run instead of starting a new one with the specific test cases set.
So every time I need to use
fdescribe
orfit
I need either to wait that the current test run finishes or I have to manually kill and restart `ng testDesired behavior
Whenever something changes in the code,
ng test
should just recompile and rerun again from the beginning and taking into account any changes related to the test cases set to run (e.g. any usage offdescribe
orfit
should be taken into account without the need of restarting the cli process)The text was updated successfully, but these errors were encountered: