question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No tests found on 'ng test' with dot in the path to the root directory

See original GitHub issue

Describe 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)

  1. ng new jest-app
  2. npm i -D jest @types/jest @angular-builders/jest
  3. adjust angular.json to use new builder
  4. npm run test -> ng test

Expected behavior All tests are discovered

Builder:

Libraries

  • angular-devkit/build-angular: from 0.802.2 to 0.803.19

Additional context

  • node.js: 12.13.0

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:19 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
arturovtcommented, Nov 18, 2019

No, not enough. I ran through them and don’t see such errors.

0reactions
paddotkcommented, Jun 3, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found