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.

Rerun all tests when package.json changes

See original GitHub issue

Clear and concise description of the problem

Currently if package.json changes and you’re running tests with the --changed flag you will get no tests running.

image

Suggested solution

Run all tests when package.json has changed

Alternative

No response

Additional context

No response

Validations

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
elliotwestlakecommented, Jul 4, 2022

On what basis should we run all tests?

It’s possible a dependency update could break the tests.

Maybe we should rerun all tests that are specified in forceRerunTrigger 🤔, if any file is changed

This sounds like a great idea

0reactions
sheremet-vacommented, Jul 4, 2022

Happy to try and get a pr up for this if you need?

Sure. Just a heads up, we are filtering files here:

https://github.com/vitest-dev/vitest/blob/3e4f3bef5c8a961ffc6ea0df638dcaf629e1be75/packages/vitest/src/node/core.ts#L175

I think we should first check if any related files are in forceRerunTrigger, then if yes, just return full list of files without filtering.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Watch and rerun Jest JS tests - npm
Is there a way of watching your source and tests to rerun Jest tests automatically when relevant files have been changed? npm ·...
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 >
npm-test
Test a package. ... Description. This runs a predefined command specified in the "test" property of a package's "scripts" object.
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 >
How To Test a React App with Jest and React Testing Library
The npm install command will install all the project dependencies defined in the ... the tests automatically re-run after a file is changed....
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