Skip to content

Commit

Permalink
Add support for running the test command in watch mode
Browse files Browse the repository at this point in the history
When running the test in watch mode, via yarn test --watch, jest enters in an infinite loop. This is due to the fact that the test/output folder is watched by jest. Exclude this folder from the watched paths.

Also, .gitignore the coverage folder generated when running yarn test --coverage.
  • Loading branch information
pmdartus authored and domenic committed Oct 19, 2019
1 parent c01a40e commit 1d5b0b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ package-lock.json

# project specific
/test/output/*
coverage/
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
"lint": "eslint ."
},
"jest": {
"testEnvironment": "node"
"testEnvironment": "node",
"watchPathIgnorePatterns": [
"<rootDir>/test/output"
]
},
"engines": {
"node": ">=8"
Expand Down

0 comments on commit 1d5b0b4

Please sign in to comment.