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.

How to run test cases of only the file currently being edited.

See original GitHub issue

Environment

  1. node -v: [fill]

  2. npm -v: [fill]

  3. npm ls jest or npm ls react-scripts (if you haven’t ejected): [fill]

  4. your vscode-jest settings if customized:

    • jest.pathToJest? [fill]
    • jest.pathToConfig? [fill]
    • anything else that you think might be relevant? [fill]
  5. Operating system: [fill]

Prerequisite

  • are you able to run jest test from command line? [fill]
  • how do you run your tests from command line? (for example: npm run test or node_modules/.bin/jest) [fill]

Steps to Reproduce

[fill]

Relevant Debug Info

[fill]

Expected Behavior

[fill]

Actual Behavior

[fill]


The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR…

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
connectdotzcommented, Apr 1, 2020

Is possible to run only on the currently opened test file?

In theory, once you turned off the jest.runAllTestsFirst, jest should only run the tests that “changed”. However, if you want to run the files opened, regardless if they are changed, which sounded like an 'on-demand" testing… such feature doesn’t exist yet… although I can see it could be useful for some use case… PR is welcome.

1reaction
connectdotzcommented, Apr 6, 2021

@raphaelbs it’s not officially released in the marketplace yet, but you can install it using the VSIX file, please see “How to test” section in v4.0.0-alpha.5 release note.

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
JEST: Is there a solution to run tests only for changed ...
First you'll want to get a list of all the changed files through Git. This can be achieved through a function like the...
Read more >
Running the Current Test File in VS Code - Atomic Spin
Scrolling the Terminal. Using a keyboard shortcut to execute the test runner for the file currently being edited works quite well in VS...
Read more >
Selecting test cases to run by checking what's changed
Then check if lines from each coverage are currently different (or there's a new test) - if so, add it to the testcases...
Read more >
Running manual tests in off-line mode - IBM
To run a manual test off-line: Export the file from the Engineering Test Management repository: Locate the test case execution record or test...
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