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

Jest won't run a specific test spec file from CLI #6014

Closed
saritvakrat opened this issue Apr 17, 2018 · 6 comments
Closed

Jest won't run a specific test spec file from CLI #6014

saritvakrat opened this issue Apr 17, 2018 · 6 comments

Comments

@saritvakrat
Copy link

Do you want to request a feature or report a bug?
Bug report
What is the current behavior?
When I run all my test spec files together jest runs them all. But when I want to run a single spec file using 'jest path/to/my-test.js' I get the following error:

No tests found in C:\Users\User\Documents\folder12 files checked. testMatch: **/__tests__/**/*.js?(x),**/?(*.)(spec|test).js?(x) - 4 matches testPathIgnorePatterns: \\node_modules\\ - 12 matchesPattern: .\_tests_\API\tickers.spec.jS - 0 matches error An unexpected error occurred: "Command failed.Exit code: 1

Code structure:
tests
API
tickers.spec.js

What is the expected behavior?
tickers.spec.js should run

Run npx envinfo --preset jest in your project directory and paste the
results here

System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz Binaries: Yarn: 1.5.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD

@SimenB
Copy link
Member

SimenB commented Apr 17, 2018

Seeing as you're on windows, have you tried jest path\to\my-test.js?

@avne31
Copy link

avne31 commented Apr 23, 2018

kindly include test match in the "jest":{"testMatch":[path that you wants to run]} of package.json.
and then simply write jest in cmd.

@thymikee
Copy link
Collaborator

Wonder if this PR #5941 fixes it? You should be able to try this using jest@beta

@github-actions
Copy link

This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Feb 25, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants