Skip to content
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

Make it easier to run jest tests for single file with vs code #2768

Closed
leon opened this issue Mar 31, 2020 · 4 comments
Closed

Make it easier to run jest tests for single file with vs code #2768

leon opened this issue Mar 31, 2020 · 4 comments
Labels
outdated scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx stale

Comments

@leon
Copy link
Contributor

leon commented Mar 31, 2020

Expected Behavior

Allow me to go into .spec.ts file and press "Run Jest for Current File"

Please describe the behavior you are expecting

Current Behavior

In vs code we can pass in the current file that should be tested.
but I always need to pass in the lib or else jest will run all my tests before the debugger stopping on my file.

This makes it very hard to get started with debugging your libs.

Proposal

we could add a helper method to nx, that will return the lib / app name for the current file.
that way we could pass this in as the lib name in launch.json.

or we could add a test-file command which would do this for us.

Wallaby

I'm also using wallaby, and you have the same problem there, where you first need to specify which lib directory you want to run.

Going forward

If we can discuss what the best solution would be. I will be happy to implement it.

@jaysoo jaysoo added the scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx label Apr 1, 2020
@github-actions github-actions bot added the stale label May 29, 2020
@vsavkin vsavkin removed the stale label May 29, 2020
@nrwl nrwl deleted a comment from github-actions bot May 29, 2020
@github-actions
Copy link

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

@github-actions github-actions bot added the stale label Mar 29, 2021
@barbados-clemens
Copy link
Contributor

If you're wanting to just click a button and run a single file using a vscode extension is the best way to go. this is the one we recommend https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner

you can also just use the jest cli to run a single file as we try to keep that compatibility for reasons like this.

@igor-q-bio
Copy link

@leon Do you know if this still an issue with the Wallaby?

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx stale
Projects
None yet
Development

No branches or pull requests

5 participants