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

jest --watch runs tests twice after editing a file #10514

Closed
kumar303 opened this issue Jun 27, 2017 · 3 comments · Fixed by mozilla/addons-frontend#5793
Closed

jest --watch runs tests twice after editing a file #10514

kumar303 opened this issue Jun 27, 2017 · 3 comments · Fixed by mozilla/addons-frontend#5793
Assignees
Labels
qa:not_needed repository:addons-frontend Issue relating to addons-frontend
Milestone

Comments

@kumar303
Copy link
Contributor

Describe the problem and steps to reproduce it:

Run yarn test, edit a file.

What happened?

Sometimes the tests are run twice

What did you expect to happen?

They should only be run once for each file change

Anything else we should know?

This is happening because our WebpackIsomorphicToolsPlugin auto-generates a webpack-assets.json file. The change to this file triggers a second test run.

It is not yet possible to ignore changes to this file and I haven't found a good workaround yet.

@kumar303
Copy link
Contributor Author

To clarify: the webpack-assets.json file is only getting generated because of yarn dev:amo (which is typically running in a separate shell for me) which has its own watcher/builder.

@muffinresearch
Copy link
Contributor

@kumar303 is this still happening?

@kumar303
Copy link
Contributor Author

kumar303 commented Feb 6, 2018

Yes but there is now an option called watchPatchIgnorePatterns that we can use to fix it! I think we just need to ignore all the things that webpack touches on a rebuild (sri.json? I forget).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qa:not_needed repository:addons-frontend Issue relating to addons-frontend
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants