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

Test issue: one test file affecting following test when webpack@next compilation not completed #682

Closed
knagaitsev opened this issue Jul 22, 2020 · 1 comment

Comments

@knagaitsev
Copy link
Contributor

  • Operating System: CI Environment (Windows, Linux, Mac)
  • Node Version: Any
  • webpack Version: v5 (webpack@next)
  • webpack-dev-middleware Version: v4

Expected Behavior

Different test files with different webpack compilations should not affect one another

Actual Behavior

See: #674 (comment)

The previous test file: api.test.js had a test with a webpack compilation that was not being completed before the test file finished. In api.test.js, jest.spyOn is applied to the done hook of compilations. The problem was that the very first test of the next test file being run (getFilenameFromUrl.test.js) was not getting its done hook called, making the test fail. This problem was solved in the test files by forcing api.test.js to wait for compilation completion.

This problem could be caused by jest itself, or possibly by how webpack@next hooks are handled.

I could not reproduce the problem locally. It consistently happened on CI.

How Do We Reproduce?

See: #674 (comment)

@alexander-akait
Copy link
Member

I think we can close it, because we rewrite tests, anyway if it happens again I will reopen this

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

2 participants