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

Doesn't work with cmd on windows 10 #53

Closed
wald-tq opened this issue Dec 19, 2019 · 12 comments
Closed

Doesn't work with cmd on windows 10 #53

wald-tq opened this issue Dec 19, 2019 · 12 comments
Labels

Comments

@wald-tq
Copy link

wald-tq commented Dec 19, 2019

Right clicking on a test name and selecting "Run Jest" doesn't work with windows 10 and cmd as default shell.

following error message appears:

E:\dev\EM Cloud\cloud-portal\backend>cd "e:\dev\EM Cloud\cloud-portal\backend"; node "e:/dev/EM Cloud/cloud-portal/backend/node_modules/jest/bin/jest.js" "e:/dev/EM Cloud/cloud-portal/backend/tests/login.test.ts" -t "Register new user successful"
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch.

It works using Powershell or Git bash as default shell.

@entranced
Copy link

'Debug jest' and 'Run jest' don't seem to be working in cmd or Powershell.
'Run Jest File' works with Powershell.

@firsttris firsttris added the bug label Dec 19, 2019
@firsttris
Copy link
Owner

hey, the slashes of everything what comes after node .... are incorrect for windows.
this worked once.

Will fix this issue soon.

in the mean time just use powershell :)

@yaagma
Copy link

yaagma commented Jan 3, 2020

Hello. I think it would be enough to replace the ';' with '&'.

For example, the command generated by "Run jest" is:

cd "c:\..." ; node "c:/.../jest.js" "c:/...main.test.ts" -t "^check result value$"

It works if I change ';' with '&':

cd "c:\..." & node ...

I hope it helps.
Raúl

@firsttris
Copy link
Owner

does && work with cmd as well? this would also work for bash.

@yaagma
Copy link

yaagma commented Jan 5, 2020

Yes, it works, but it is not exactly the same as &. With &&, the second command only is executed if the first doesn't fail:
From Microsoft docs:

Character Definition
Use to separate multiple commands on one command line. Cmd.exe runs the first command, and then the second command.
&&  Use to run the command following && only if the command preceding the symbol is successful. Cmd.exe runs the first command, and then runs the second command only if the first command completed successfully.

I think that, for "Run Jest", the difference doesn't matter and && could be used.

Thanks for this great extension.
Raúl

Ps: By the way. ¿Are codelens for "Debug Jest"/"Run Jest" in your plans?

@wald-tq
Copy link
Author

wald-tq commented Jan 7, 2020

Ps: By the way. ¿Are codelens for "Debug Jest"/"Run Jest" in your plans?

That would be cool!

@firsttris
Copy link
Owner

firsttris commented Jan 7, 2020

codelens option would be nice indeed 👍

i have created another issue for this feature: #56
if you have some more information on this topic (like API details), feel free to post it there.

i want to fix the remaining issues first.

but if you are able to implement something like this, im happy about any PR.

@heavenkiller2018
Copy link

in the mean time just use powershell :) yes, i got it !

@firsttris
Copy link
Owner

please verify and report back if your issue is solved with 0.4.12

@firsttris
Copy link
Owner

changed ; to &&

@wald-tq
Copy link
Author

wald-tq commented Jan 21, 2020

Hi Tristan,

it works with cmd but not with powershell:

The token '&&' is not a valid statement separator in this version.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : InvalidEndOfLine

@firsttris
Copy link
Owner

fixed it with 0.4.15. it seems && is supported by cmd, bash, fish but not powershell. its harder then you think to support all terminals also considering multi workspace setups and mono repos.

feel free to re-open or create a new issue if you find one.

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

5 participants