-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
vscode 1.32.1 jest debug cannot find test files specified if running from current file #70050
Comments
(Experimental duplicate detection) |
I have the same issue. |
Does it work with the latest Insiders? |
Can confirm this is happening on a fresh install of latest Insiders using
|
Seeing the same thing. Looks like this is a regression of #40256 with |
I confirm that there seems to be a breakage with ${relativeFile} to use win specific slashes on windows. |
After investigating with @alexr00 and @weinand we do confirm that the
Please file this bug against Jest that it should hande backslashes on windows. As a workaround instead of using We should have announced this change in the release notes and we appologise that we did not. |
@isidorn In my case I can't your proposed solution of hardcoding the path, because the path can change based on the selected file. |
@isidorn I finally found a clean solution to this problem. I agree that the path format for the variables should be consistent and inline with the platform. {
"label": "Task",
"type": "shell",
"command": "myScript",
"args": [
"${relativeFile}"
]
} the backslashes were interpreted as escape characters rather being part of the string, the script was seeing the argument {
"label": "Task",
"type": "shell",
"command": "myScript",
"args": [
"\"${relativeFile}\""
]
} Then in my script when I receive the parameters I can transform all the back slashes in forward slashes with a variable replacement, something like in bash: relativeFile=${1//\\/\/}" So far this seems to work nicely and my make |
This however breaks the WSL use case. Is there a way, when |
I forgot to add my workaround for anyone who needs it. Basically, replace For example, if all of your test files are under {
configurations: [
{
// ... test launch config
"args": [
// ... desired args
"src/test/${input:testPath}" // instead of "${relativeFile}"
]
}
],
"inputs": [
{
"id": "testPath",
"description": "Please enter a test path",
"default": "", // wish we could add ${fileBasename} here but seems like it's impossible
"type": "promptString"
}
]
} But I do hope this can stay as a workaround, and that |
Steps to Reproduce:
Does this issue occur when all extensions are disabled?: Yes
It works fine with previous version of VS Code
The text was updated successfully, but these errors were encountered: