[feature] Ability to pass through options to jest via ng test
I'm currently experiencing issues where my CI memory limit is being maxed since jest sets a worker for each existing CPU.
It would be great if I can pass in Jest CLI options through including --runInBand
A full list of CLI commands can be found here:
https://jestjs.io/docs/en/cli.html
hi @johnRambo2k14,
do you also set a --maxParallel parameter when you run affected:test, if that is the way how you start the tests via CI? but yes, setting all the cli params in angular.json to pass through to jest would be great 👍
Ah that totally escaped me! I haven't tested it out with jest just yet, I will let you know my findings.
I will add runInBand and maxWorkers as per this troubleshooting docs from jest docs.
I am holding off on passing every option into jest as there may be some which are not applicable. Having these options defined in our schema is important for ng test jest-project --help. Adding options is relatively easy to do, so we will keep maintaining it this way for the time being.
@FrozenPandaz the runInBand and maxWorkers (2) are there by default now?
I'm having memory problems with CircleCI and I'm wondering how to address this with Nx
It seems a core issue of jest ATM, related with graceful-fs:
https://github.com/facebook/jest/issues/7311
Just to clarify, the runInBand option needs to be set in angular.json:
"e2e": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "apps/api-e2e/jest.config.js",
"tsConfig": "apps/api-e2e/tsconfig.spec.json",
"runInBand": true
}
}
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.