Skip to content
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

karma 3.1.3 is not working with single entry file #3226

Closed
Havunen opened this issue Dec 3, 2018 · 6 comments
Closed

karma 3.1.3 is not working with single entry file #3226

Havunen opened this issue Dec 3, 2018 · 6 comments

Comments

@Havunen
Copy link

Havunen commented Dec 3, 2018

Expected behaviour

Karma 3.1.3 should re-process files when there is single entry point and it uses karma-webpack integration

Actual behaviour

Karma 3.1.3 does not re-process the file and no changes are picked up
Karma 3.1.1 works as expected

@segrey
Copy link
Contributor

segrey commented Dec 3, 2018

@Havunen Could you please provider steps to reproduce? A small example project would be great. Also, how do you run your karma tests?

@garyvh2
Copy link

garyvh2 commented Dec 6, 2018

@segrey here's a quick example https://github.com/garyvh2/karma-reload-problem
Just do the following:

git clone https://github.com/garyvh2/karma-reload-problem
npm install
npm test

Tests will be run on Chrome Headless, you will notice 2 tests being reported as successful.

Now, without stopping the server, go into deepCompare.spec.js and change any of the test to fail, I.E change in line 10, false into true, so you can break the inequality test.

You will notice that the tests are automatically run again, but both still successful, now, stop the tests server (ctrl + c) and run it again (npm test) without changing anything, now 1 tests is failing and the other one is successful, as you would expect.

If you try this with Karma 3.1.1 the behavior works as expected, so whenever you perform any change on the tests they are effectively run again, without you having to restart the test server.

Tell me if you need further information.

@segrey
Copy link
Contributor

segrey commented Dec 6, 2018

@garyvh2 Thanks for the repro!

johnjbarton pushed a commit that referenced this issue Dec 6, 2018
…3230)

This reverts commit 5334d1a
karma-webpack preprocessor updates bundle when needed, but karma's fileList consists of a single entry file which is usually unmodified. In this case, fileList.refresh() should always call preprocessor for the single entry file, avoiding preprocessing of unmodified files is done on karma-webpack side.
@matthieu-foucault
Copy link

matthieu-foucault commented Dec 12, 2018

It's been reported in karma-webpack too, here's another repro if you're interested: codymikol/karma-webpack#100 (comment)

Single-entry setups are quite common with karma-webpack

@johnjbarton
Copy link
Contributor

Please try 3.1.4

@Havunen
Copy link
Author

Havunen commented Dec 31, 2018

3.1.4 works fine 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants