Skip to content

Commit

Permalink
devtools: update jest config
Browse files Browse the repository at this point in the history
This change updates the jest config to specify
test environments separately for unit and e2e
tests and adds the isolated modules option to
the ts-jest config to improve test startup time.

For golang/go#43361

Change-Id: I3fbfae2a42c26bd0eeb2d235dab1cced0c8701ea
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/280711
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
  • Loading branch information
jamalc committed Jan 5, 2021
1 parent 309e95f commit 43996f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion devtools/config/jest.config.js
Expand Up @@ -2,5 +2,9 @@
module.exports = {
preset: 'ts-jest',
rootDir: '../../',
testEnvironment: 'node',
globals: {
'ts-jest': {
isolatedModules: true,
},
},
};
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -17,8 +17,8 @@
"lint-css": "stylelint **/*.css",
"license-check": "jsgl --local .",
"test-typecheck": "tsc --noEmit",
"test-unit": "jest --config devtools/config/jest.config.js content",
"test-e2e": "jest --config devtools/config/jest.config.js e2e",
"test-unit": "jest --config devtools/config/jest.config.js --env=jsdom content",
"test-e2e": "jest --config devtools/config/jest.config.js --env=node e2e",
"test": "run-s test-*"
},
"dependencies": {
Expand Down

0 comments on commit 43996f8

Please sign in to comment.