-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Ability to just run the last changed test file #119
Comments
Yep, sounds good to me. This would need to be something where the extension itself controls what test is being ran, which it currently doesn't. It'd require turning off it's |
Probably something that you'd want to be able to trigger via the command window, so alongside 'Jest start watching' + 'Jest stop watching' you might have 'Jest run last test file mode' or something better worded ! I'm very new to VSCode + extensions but I'll try to start hacking something soon. |
I've been having a think about this: I'd like the ability to toggle on a single file mode on the watcher - perhaps this could be an action button in the top right (orta/vscode-react-native-storybooks#26), which closes the current watcher and a version of the watcher that includes a suffix of the filepath. |
I love the idea of being able to run one file. If we wanted to be able to test the unsaved changes to the document, we'd need to be able to test just one file first. The other option we may not have explored yet is setting up our own reporter to stream tests results as they happen with IPC. |
Any updates on this? |
Yep, @goodbomb. I've been spending my spare time settling into a new job so I haven't had the bandwidth to review @marcinczenko's changes to PR #215. It's the blocking change to resolve this issue, so if you've got the time I'd appreciate a second set of eyes or help with some integration tests to make sure we're preserving the existing behaviour. On the PR @orta mentioned he may have some time, but with 1.7k lines added he may want some help. |
+1 |
@marcinczenko's PR has been merged if anyone wants to have a go at a PR. |
after 3 years, we finally added this feature... Please feel free to give v4.0.0-alpha.5 a try and let us know if it works for you. |
@connectdotz I read multiple times https://github.com/jest-community/vscode-jest/blob/master/README.md#how-to-trigger-the-test-run and I'm able to turn off the autorun, but as mentioned in the original post I'm looking for running only the last file/test that has changed. By default EDIT: see the solution https://stackoverflow.com/questions/75303569/how-keep-tests-shortcuts-icons-once-auto-run-is-switched-off-from-the-extensio/75303812#75303812 |
@sneko, the default autoRun is to run only changed files (the watch mode). Did I miss something? |
Just had a case where I was working on file
foo.js
andfoo.spec.js
. Foo is used in a bunch of places, so upon changing it Jest correctly figures out that it has 10 spec files that it should run. This is great most of the time, but it means that I have to wait longer to know iffoo.spec.js
has passed or not. An option to turn on a "single file" mode where it only runs the last changed spec file on each change would be quite useful.I'm quite happy to attempt some work on this if you think it's a reasonable addition :)
The text was updated successfully, but these errors were encountered: