Forrest logo
back to the jest tool

jest:tldr:6b512

jest: Run test suites related to all uncommitted files.
$ jest --onlyChanged
try on your machine

The command "jest --onlyChanged" is used with the Jest testing framework to run only the tests that are related to the code that has been changed since the last commit or the last test run.

By default, Jest executes all the tests defined in the project. However, when using the "--onlyChanged" flag, Jest will first analyze the version control system (such as Git) or the test history to identify the files that have been modified. It then runs only the tests that are associated with those modified files, skipping the tests related to unchanged files.

This command can be helpful in large projects with a large number of tests, as it enables developers to quickly execute only the relevant tests that are impacted by their recent code changes. This saves both time and system resources by avoiding running unnecessary tests.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the jest tool