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.

`nx test` does not run all tests

See original GitHub issue

I recently updated my nrwl/nx workspace to the latest version. I noted that you aliased the ng command to nx! In this context, i noticed, that nx test does not run all tests in the monorepository!

This may be a regression!

Current Behavior

nx test does not run all tests in the monorepository, ng test does, in fact, run all! (as before!)

Expected Behavior

This may be a regression! previously, i was able to run all my tests in the monorepo with ng test, however nx test does not run all tests. Running nx test from the cli, internally invokes the command ng run app-web:test

Steps to Reproduce

This issue may not be prioritized if details are not provided to help us reproduce the issue.

Failure Logs

Environment

nx report

>  NX  Report complete - copy this into the issue template

  @nrwl/angular : 9.4.3
  @nrwl/cli : 9.4.3
  @nrwl/cypress : 9.4.3
  @nrwl/eslint-plugin-nx : Not Found
  @nrwl/express : Not Found
  @nrwl/jest : 9.4.3
  @nrwl/linter : 9.4.3
  @nrwl/nest : 9.4.3
  @nrwl/next : Not Found
  @nrwl/node : 9.4.3
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 9.4.3
  @nrwl/web : Not Found
  @nrwl/workspace : 9.4.3
  typescript : 3.8.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:16
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

19reactions
vsavkincommented, Jul 9, 2020

This is be design. Different projects in the repo can use different test runners, different configurations etc, so there is no way for us to run all of them in the same process. npx nx run-many --all --target=test is the way to do it. You can also run them in parallel, as follows: npx nx run-many --all --target=test --parallel

17reactions
lazarljubenoviccommented, Jan 28, 2021

The default script "test": "nx test", from the root package.json should then probably be changed to nx run-many --all --target=test.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jestjs - @nrwl/nx angular Run all test for coverage in a single ...
run all projects​​ I tried to run all tests in every app and library with the nx run-many command. I get a coverage...
Read more >
run-many - CLI command - Nx
Install nx globally to invoke the command directly using nx , or use npx nx , yarn nx , or pnpm nx ....
Read more >
Run tests | WebStorm Documentation - JetBrains
If you don't know why a test fails, you can debug it. In the editor, click the gutter on the line where you...
Read more >
Setting Up A DevOps Pipeline With Nx - Christian Lüdemann
Nx will test your application and cache the result of the test. If you run the same command again, the results will be...
Read more >
Testing Nrwl Nx Angular Monorepo Projects using JEST
To debug tests using Chrome Devtools or an IDE you can run the test command through node's --inspect-brk flag. Below script to run...
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