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

No tests found on Windows 10 using VS Code 1.31.1 #17

Closed
infin8loop opened this issue Feb 14, 2019 · 4 comments
Closed

No tests found on Windows 10 using VS Code 1.31.1 #17

infin8loop opened this issue Feb 14, 2019 · 4 comments
Labels

Comments

@infin8loop
Copy link

On Windows, regexForTestFiles jest parameter is generated with an absolute path that uses backslashes \. This causes no matching test files to be found. Changing the backslashes to forward slashes / causes it to work.

This behavior is new and it might coincide with the latest update to VS Code (1.31.1). Has there been a change to the way that VS Code returns the file path? Or perhaps it's related this jest issue: jestjs/jest#6546?

@firsttris firsttris added the bug label Feb 14, 2019
@gpascual2
Copy link

I think this might be also related to this issue: jestjs/jest#3793

It is a regex matter parsing the path to the while in windows. One solution that worked for me is changing the path to use forward slashes as reported above. Also works scapping the back slashes in the path using the double backslash \\ as node "c:\myproject\node_modules\jest\bin\jest.js" "c:\\myproject\\src\\some_folder\\file.test.ts" -t "spec-title"

@infin8loop
Copy link
Author

Thanks for the link to the related issue. Yeah, escaping the backslashes works as well, as does removing the path to use only the file name. However, having to edit the generated command in any way takes all the goodness out of this super handy extension. It's probably just a matter of needing to re-parse the file path that is returned by editor.document.fileName to get around the regex issue?

@zhaoxuyll
Copy link

zhaoxuyll commented Feb 17, 2019

fix at #19

@firsttris
Copy link
Owner

fixed with #19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants