Skip to content

Commit

Permalink
fix(jest): reduce memory usage (#8753)
Browse files Browse the repository at this point in the history
* fix(jest): reduce memory usage

By combining `node --expose-gc` with `jest --logHeapUsage`.

* fix(jest): isolate modules with ts-jest

* ci(pr-kumascript): run if {jest.config,package}.json change
  • Loading branch information
caugner authored May 4, 2023
1 parent e1366c5 commit 47910ee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/pr-kumascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
paths:
- kumascript/**
- .github/workflows/pr-kumascript.yml
- jest.config.json
- package.json
- yarn.lock

jobs:
Expand Down
1 change: 1 addition & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"ts-jest",
{
"babelConfig": true,
"isolatedModules": true,
"useESM": true
}
]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"filecheck": "ts-node filecheck/cli.ts",
"install:all": "find . -mindepth 2 -name 'yarn.lock' ! -wholename '**/node_modules/**' -print0 | xargs -n1 -0 sh -cx 'yarn --cwd $(dirname $0) install'",
"install:all:npm": "find . -mindepth 2 -name 'package-lock.json' ! -wholename '**/node_modules/**' -print0 | xargs -n1 -0 sh -cx 'npm --prefix $(dirname $0) install'",
"jest": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
"jest": "node --experimental-vm-modules --expose-gc ./node_modules/.bin/jest --logHeapUsage",
"m2h": "ts-node markdown/m2h/cli.ts",
"prepack": "yarn build:dist",
"prepare": "husky install && yarn install:all && yarn install:all:npm",
Expand Down

0 comments on commit 47910ee

Please sign in to comment.