CPU spikes when running Jest unit tests through a Husky pre-commit hook #16538
Unanswered
landisdesign
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I use Husky to run a pre-commit hook to run my unit tests. I'm using Jest to do this.
When I run the unit tests directly in the terminal, they run quietly in the background, using some CPU but permitting the use of other applications on my computer. Using the web seems relatively unaffected.
When I run the pre-commit hook that calls the same
yarncommand, however, everything starts freezing on my computer. Web pages become sluggish and unresponsive and VSCode becomes incredibly slow.I'm using a very old version of Husky, but hopefully this is reproducible with newer versions as well. (I'm trying to avoid upgrading, just because it is a chunk of work.)
System details:
Version: 1.67.0
Commit: 57fd6d0195bb9b9d1b49f6da5db789060795de47
Date: 2022-05-04T12:14:47.100Z
Electron: 17.4.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Darwin x64 19.6.0
Husky 2.7.0
Jest 27.5.1
My default version of node is 16.13.2.
Beta Was this translation helpful? Give feedback.
All reactions