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

karma test command doesn't work in windows #1883

Closed
HarsimranVirk opened this issue Jul 20, 2020 · 4 comments · Fixed by #1881
Closed

karma test command doesn't work in windows #1883

HarsimranVirk opened this issue Jul 20, 2020 · 4 comments · Fixed by #1881

Comments

@HarsimranVirk
Copy link
Contributor

"test": "./node_modules/karma/bin/karma start --browsers ChromeHeadless --single-run",
"test:firefox": "./node_modules/karma/bin/karma start --browsers Firefox --single-run"

These don't work on windows because ./something/app results in '.' is not recognized as an internal or external command, operable program or batch file. due to differences of backslash/frontslash.

Maybe a more inclusive command could be "test": "cd ./node_modules/karma/bin && karma start ../../../karma.conf.js --browsers ChromeHeadless --single-run" (and similar for firefox) as this should work in all environments 😅

@arthuro555
Copy link
Contributor

I always jusr manually run karma like this if I remember correctly: .\node_modules\.bin\karma.cmd start --browsers ChromeHeadless --single-run

@HarsimranVirk
Copy link
Contributor Author

@arthuro555 .\something\app works fine as cmd understands .\ but not ./ due to differences between frontslash and backslash 😅. This is why it's better to change directory (as both windows and linux/macOS would interpret them correctly) and then run karma, and because we are in a different dir, specify the correct path to karma.conf.js (which is ../../../karma.conf.js in this case).

@arthuro555
Copy link
Contributor

arthuro555 commented Jul 22, 2020 via email

@HarsimranVirk
Copy link
Contributor Author

if karma is in node_modules/.bin, we should call karma directly and it should call the version installed in node_modules automatically

Yes, this could be the most correct way I'd say then 👍

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

Successfully merging a pull request may close this issue.

2 participants