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

Default test not found if project path contains hyphens #542

Closed
insin opened this issue Sep 2, 2016 · 1 comment · Fixed by jestjs/jest#1574
Closed

Default test not found if project path contains hyphens #542

insin opened this issue Sep 2, 2016 · 1 comment · Fixed by jestjs/jest#1574

Comments

@insin
Copy link
Contributor

insin commented Sep 2, 2016

Seeing this running npm test in a new project created with create-react-app@0.3.0:

cmd_2016-09-02_11-41-46

Any pointers as to which Jest module I should poke around in to debug this?

@insin
Copy link
Contributor Author

insin commented Sep 2, 2016

If I log the value of this._testPathDirPattern in jest-cli/build/SearchSource.js, I'm seeing hyphens being prefixed with a literal \:

/C:\\Users\\Jonny\\repos\\tmp\\cra\\-030\\-app/

If I remove the hypen from escapeStrForRegex in jest-util/build/index.js, the test is found:

  const escapeStrForRegex =
- string => string.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+ string => string.replace(/[[\]{}()*+?.,\\^$|#\s]/g, '\\$&');

@insin insin changed the title Default test not found on Windows Default test not found if project path contains hyphens Sep 2, 2016
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant