Unable to run Jest tests with custom reporter
See original GitHub issueDescribe the bug Unable to run Jest tests with a custom reporter (https://jestjs.io/docs/en/cli#reporters).
To Reproduce
- Run
ng test
. OK - Run
ng test --reporters=default
. Failure:
ng test --reporters=default
Schema validation failed with the following errors:
Data path ".reporters" should be array.
- Run
ng test --reporters=default --reporters=default
. OK
Expected behavior
Jest builder should be able to pass single --reporters
option to Jest.
Builder:
@angular-builders/jest@7.0.0
Libraries
@angular-devkit/build-angular@0.10.6
Additional context
Looks like the issue is relevant for some other array options, e.g. --testPathPattern
. But the issue is not reproduced for --runTestsByPath
, though it doesn’t work with --runTestsByPath
either.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:18 (8 by maintainers)
Top Results From Across the Web
The 4 stages of flakiness (part 2/3): log failed tests with a Jest ...
Creating a custom reporter would allow to both control the output of the test run and build the report file. We settled for...
Read more >Troubleshooting - Jest
Troubleshooting. Uh oh, something went wrong? Use this guide to resolve issues with Jest. Tests are Failing and You Don't Know Why.
Read more >Cannot find module @jest/reporters when running 'detox test'
If this is due to peer dependency, you can try npm install @jest/reporters manually since peer dependencies are not auto installed in npm...
Read more >Writing a Jest Test Reporter - JavaScript in Plain English
Jest is an amazing test framework but its custom test reporter ... in time such as total number of tests run so far,...
Read more >Configuring Jest
By default, Jest runs all tests and produces all errors into the console upon completion. ... Use this configuration option to add custom...
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
@meltedspark Thanks a lot for the fix!
Looks like, now tests can be run without
=
sign too: bothng test --reporters default
andng test --reporters=default
work for me with@angular-builders/jest@7.2.1
. BTW, I’m a maintainer of Jest test runner in JetBrains IDEs, feel free to ping me regarding IDE-related issues.@meltedspark JetBrains IDE integration (for Angular projects using Jest runner) passes
--reporter
. This issue is required for it to be working.