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

BACKLOG-15926 - Fix memory usage in tests #956

Merged
merged 12 commits into from
Apr 30, 2021
Prev Previous commit
Next Next commit
Upgraded jest and added something to force garbage collection
  • Loading branch information
Fgerthoffert committed Apr 30, 2021
commit def40f86bc08aeabde531d888593d56ef5c0e9cc
6 changes: 6 additions & 0 deletions force-gc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// https://github.com/facebook/jest/issues/7311
afterEach(() => {
if (global.gc) {
global.gc();
}
});
9 changes: 7 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
const jestConfig = require('@jahia/test-framework').jestConfig;
let jestConfig = require('@jahia/test-framework').jestConfig;

module.exports = jestConfig;
module.exports = {
...jestConfig,
setupFilesAfterEnv: [
'<rootDir>/force-gc'
]
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.2",
"file-loader": "^6.1.0",
"jest": "^26.4.2",
"jest": "^26.6.3",
"node-sass": "^4.13.1",
"redux-mock-store": "^1.5.4",
"redux-test-utils": "^1.0.0",
Expand Down
Loading