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
Jest: Neither --config nor --configuration works with v14 #1236
Comments
I debugged a bit and found out, that the
[
'--tsConfig=./src/tsconfig.spec.json',
'--no-cache',
'--config=test',
'--globalMocks=getComputedStyle',
'--globalMocks=doctype',
'--globalMocks=styleTransform',
'--globalMocks=matchMedia',
'--notifyMode=failure-change',
'--prettierPath=prettier',
'--config',
'{"preset":"jest-preset-angular",[...]}'
Also I realized, that no options from my |
Do I get it right that with Angular v13 it works as expected and with Angular 14 not? |
Correct. I just tested it with @angular-builders/jest v13.0.3 and Angular 14.0.0 and it shows the same error, so it seems to be a side effect of Angular changes. |
Could you please provide a repo with minimal reproduction? Also, a workaround to try in meanwhile - use |
https://github.com/RTK/angular-builders-jest-example Setup via "npm install" and then run "ng test --configuration=test", then you should get the error I described. The workaround works for now, thanks! |
Is |
Unfortunately no since both angular configuration AND jest configuration have the same -c alias |
I have same problem after upgrade to Angular 14, `
and I run run my angular.json configuration as follows. |
Thanks for the report guys and sorry it took so long to deal with it. |
Should be fixed in |
Now it works just fine! Thanks! |
Describe the Bug
After upgrading to version 14 I can no longer pass in the
--configuration
argument since it throws an error. The same goes for the--config
option.Also I have noticed, that when running
ng test --help
it prints for both--config
and--configuration
flag the abbreviation-c
. Maybe this leads to this error.Minimal Reproduction
Install latest version (v14), configure project and run
ng test --configuration=test
. It wil exit with an error (exit code 1) and print out the usage infoUsage: ng [--config=<pathToConfigFile>] [TestPathPattern]
. Also at the very end there is the errorargv.config.match is not a function
.Expected Behavior
It should take either the angular configuration or the jest config and not throw an error.
Screenshots
Environment
The text was updated successfully, but these errors were encountered: