Jest: Neither --config nor --configuration works with v14
See original GitHub issueDescribe 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 info Usage: ng [--config=<pathToConfigFile>] [TestPathPattern]
. Also at the very end there is the error argv.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
$ ng test --configuration=test
Warning: 'no-cache' option has been declared with a 'no' prefix in the schema.Please file an issue with the author of this package.
Warning: 'noStackTrace' option has been declared with a 'no' prefix in the schema.Please file an issue with the author of this package.
Usage: ng [--config=<pathToConfigFile>] [TestPathPattern]
Options:
-h, --help Show help [boolean]
--version Show version number [boolean]
--all The opposite of `onlyChanged`. If
`onlyChanged` is set by default, running
jest with `--all` will force Jest to run all
tests instead of running only tests related
[...]
test re-run in watch mode. If the test path
matches any of the patterns, it will be
skipped. [array]
--watchman Whether to use watchman for file crawling.
Disable using --no-watchman. [boolean]
Documentation: https://jestjs.io/
argv.config.match is not a function
Environment
Libs
- @angular/core version: 14.0.5
- @angular-devkit/build-angular version: 14.0.5
- @angular-builders/jest version: 14.0.0
- Jest: 28.1.2
For Tooling issues:
- Node version: v16.14.2
- Platform: Mac
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Can't run tests with jest 28.0 · Issue #10117 · nrwl/nx - GitHub
I had to work on setting up my resolver to remove object properties from the parsed package.json so it would target main instead...
Read more >Configuring Jest
Jest's configuration can be defined in the package.json file of your project, or through a jest.config.js, or jest.config.ts file or through ...
Read more >How to use ESM tests with jest? - Stack Overflow
Here are the steps I took to run Jest with a test using ESM. The source files under test were also written using...
Read more >Jest | RubyMine Documentation - JetBrains
Open the Run/Debug Configuration dialog (Run | Edit Configurations on the main menu), click · Specify the Node. · Specify the location of...
Read more >Configuration | ts-jest - Huafu
ts-jest configuration is done within Jest configuration object. This latest can be in package.json under the jest property, or in its own jest.config.js...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I debugged a bit and found out, that the
--config
argument gets passed twice to jest:--configuration=test
gets transformed into--config=test
but the builder hardcodes a--config=[builder specific configurations]
as well ->argv.push('--config', JSON.stringify(configuration));
Also I realized, that no options from my
test
Angular configuration gets added to theargv
.Should be fixed in
14.0.2-beta.1
, please confirm.