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.

ng test <project> --find-related-tests doesn't seem to work

See original GitHub issue

Is your feature request related to a problem? Please describe.

On git commits I’d like to be able to run only related tests, using husky and lint-staged.

The problem is, when I run:

ng test <project> --find-related-tests ./src/source.js

I can see the path is treated as an option, and I get the error

Unknown option: './src/source.js'

For comparison, the following works fine, so I know this option and its value are being passed to JEST:

ng test <project> --testNamePattern="component" (runs all specs with ‘component’ in the name)

Describe the solution you’d like I would like the path to be supported and passed to JEST

Describe alternatives you’ve considered I’m considering using husky/lint-staged to run a different batch of tests based on the changed files.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
pierceocommented, Aug 18, 2021

Sorry for the delay, I just checked. It works fine now, thanks.
It seems the schema has changed though, I had to update the options to solve these errors:

image

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular: ng test runs but doesnt execute test cases
I have created new Angular 6 project and tried ng test it works there but doesn't work on my project. I have deleted...
Read more >
Make your Angular tests 1000% better by switching from ...
One of the projects I'm working on has an Angular 8 frontend with over 1000 unit/component tests. These used to all run in...
Read more >
Angular cli - `ng test` doesn't run? - Visual Studio Feedback
I have a project in VS Team Services with CI Build. ... The angular-cli (@angular/cli@1.0.0) seems to be working fine, as the previous...
Read more >
Run jest for unit tests of modified files only | by SunCommander
In this article, you will learn how to run Jest for modified files only in a Pull Request. This can be done using...
Read more >
Testing - Angular Hispano
Testing your Angular application helps you check that your app is working as ... The ng test command builds the app in watch...
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