No tests found on 'ng test' with dot in the path to the root directory
See original GitHub issueDescribe the bug
When I do ng test
- it doesn’t find any single test.
Firstly, I tried that on existing project (which is using jest but via jest cli and I know tests exist) -> 0 tests discovered.
Then, I tried new project (via ng new
) -> 0 tests discovered.
At last, I downloaded simple-app
example -> 0 tests discovered.
And I have no idea what I am doing wrong or haven’t configured properly.
Any ideas what’s the reason?
Ask for more information -> will provide information that might help.
To Reproduce (for instance, new project)
ng new jest-app
npm i -D jest @types/jest @angular-builders/jest
- adjust
angular.json
to use new builder npm run test
->ng test
Expected behavior All tests are discovered
Builder:
- @angular-builders/jest
- 8.2.0
Libraries
angular-devkit/build-angular
: from 0.802.2 to 0.803.19
Additional context
node.js
: 12.13.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (6 by maintainers)
Top Results From Across the Web
angular - Declaration file missing when running ng test
After trying several things, I settled by adding the actual library and include it only for testing in angular.json:
Read more >ng test
Option Description Value Type Defau...
‑‑browsers Override which browsers tests are run against. string
‑‑code‑coverage Output a code coverage report. boolean false
‑‑code‑coverage‑exclude Globs to exclude...
Read more >Angular CLI - ng test Command
This chapter explains the syntax, argument and options of ng test command along with an example. Syntax. The syntax for ng test command...
Read more >Angular CLI: “ng test” with Jest in 3 minutes (v2)
In tsconfig.spec.json (root directory or project roots, used by Jest):. Replace jasmine in types array with jest. You want your tests to be...
Read more >Error Messages
Test File Errors No tests found This message means that Cypress was unable ... This is most likely because the maximum path length...
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
No, not enough. I ran through them and don’t see such errors.
I had the same issue, but it turns out that when a test fails, the test runner claims there were no tests found. In other words, the wrong error is given.