lucono/karma-test-explorer

does not work when extension is in a path with a a space in the name

Closed this issue · 6 comments

air2 commented

Describe the bug
unfortunately my user name on windows contains a space (yes I want to strangle the sysadmin who did this too) anyway my user folder now contains a space. Therefor the visual code extension is in a folder path with a space. Now the ng test command will not load.

To Reproduce
Steps to reproduce the behavior:
Make sure the extension is in a folder with a space in the name

Expected behavior
It should work with the --karma-config=c:\Users\A. Bruinsma.vscode\extensions\lucono.karma-test-explorer-0.1.0\dist\karma.conf
I think some quotes would help.

Logs
[2021-10-05 12:36:49.952] [INFO] [Adapter]: Initializing adapter
[2021-10-05 12:36:49.953] [INFO] [MainFactory]: Using test framework: jasmine
[2021-10-05 12:36:49.953] [INFO] [MainFactory]: Loading test info from test files
[2021-10-05 12:36:49.955] [INFO] [MainFactory]: Project detected as Angular project
[2021-10-05 12:36:49.956] [INFO] [AngularFactory]: Selected default Angular project 'app' at root path 'c:\code\myProject\app' and karma config file 'c:\code\myProject\app\karma.conf.js'
[2021-10-05 12:36:50.376] [INFO] [DefaultTestManager]: Using requested --> available karma port: 9976 --> 9976
[2021-10-05 12:36:50.407] [INFO] [DefaultTestManager]: Using requested --> available karma listener socket port: 9999 --> 10000
[2021-10-05 12:36:50.437] [INFO] [DefaultTestManager]: Using requested --> available debug port: 9222 --> 9223
[2021-10-05 12:36:50.439] [INFO] [KarmaTestServer]: Starting karma server
[2021-10-05 12:36:50.446] [INFO] [KarmaTestEventListener]: Waiting on port 10000 for Karma to connect
[2021-10-05 12:36:52.479] [ERROR] [CommandLineProcessHandler]: Process ixmt2m6d1ra - Error from child process: 'Error: spawn npx ENOENT' - for command: npx ng test app --karma-config=c:\Users\A. Bruinsma.vscode\extensions\lucono.karma-test-explorer-0.1.0\dist\karma.conf --progress=false --no-watch
[2021-10-05 12:36:53.405] [WARN] [SpecLocator]: No tests found in spec file: c:/code/myProject/app/src/app/shared/test-fixture.spec.ts
[2021-10-05 12:36:53.890] [WARN] [SpecLocator]: No tests found in spec file: c:/code/myProject/app/src/app/shared/test-fixture.spec.ts

Please complete the following information:

  • OS: Windows 10
  • Environment Just normal windows 10 with vs code 1.60.02
  • Version v0.1.0

Additional context

Hi @air2, your log snippet is very helpful. Can you also post the logs from the Karma Server output panel? That will give a better sense of the issue and how to reproduce.

air2 commented

stderr: Unknown option: 'Bruinsma.vscode\extensions\lucono.karma-test-explorer-0.1.0\dist\karma.conf'

air2 commented

That is the only line shown. So I think the full path has to be in quotes when send to the command, because it has a space in the name.

Thanks @air2, I've been able to reproduce in a Windows VM. Will fix and publish to the marketplace.

@air2 I've published v0.2.0 (changelog) with a fix for this and other issues. Let me know if you run into any other problems with the updated version.

@air2 Closing as haven't heard back. Thanks for filing the issue, and feel free to file another issue if you run into any other problems with the extension.