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

chore(js): improve jest watch performance by excluding node_modules #6084

Merged
merged 1 commit into from
Jul 9, 2020

Conversation

IanLondon
Copy link
Contributor

Overview

Jest in watch mode consumes a lot of file watcher resources. It's watching many node_modules files it doesn't need to watch. On Linux, even after adding inotify resources, yarn jest --watch (or even yarn jest --watch protocol-designer/src) takes a few minutes to start and sometimes times out a few times unless I kill flow or something and try again.

Related issue: jestjs/jest#3254

Changelog

Update Jest config to exclude any /node_modules/ paths from the file watch

Review requests

  • Jest tests still pass, same number of tests run (config not excluding any tests)
  • Jest watch startup time might be significantly faster (at least on Linux it is!)

Risk assessment

low to medium, messing with jest config

@IanLondon IanLondon requested review from mcous, shlokamin and a team July 8, 2020 14:39
@IanLondon IanLondon changed the title chore(js): improve jest performance by excluding node_modules chore(js): improve jest watch performance by excluding node_modules Jul 8, 2020
Copy link
Contributor

@mcous mcous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How on earth is this not the default?

Copy link
Member

@shlokamin shlokamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eeeeeeeep. Thanks for this!

@IanLondon IanLondon merged commit f29d0fc into edge Jul 9, 2020
@IanLondon IanLondon deleted the js_improve-jest-perf branch July 9, 2020 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants