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

KarmaTestAdapter.json Causes parsing error. #40

Open
gravidThoughts opened this issue Jun 18, 2015 · 0 comments
Open

KarmaTestAdapter.json Causes parsing error. #40

gravidThoughts opened this issue Jun 18, 2015 · 0 comments

Comments

@gravidThoughts
Copy link

Hi Morten!

Love what you have done with this VS extension.

I am having an issue when introducing a KarmaTestAdapter.json file. The following exception is being logged.

[18.06.2015 11:22:57.007] [Karma] [Debug] [ktaGlobal] [Server] Starting Karma: "C:\Program Files\nodejs\node.exe" C:\USERS\CCOPELM2\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\12.0\EXTENSIONS\YTJIVBEN.CL0\KarmaTestServer\Start.js --name ktaGlobal --karma karma.conf.js --settings KarmaTestAdapter.json
[18.06.2015 11:22:57.007] [Karma] [Debug] [ktaGlobal] TestContainer created
[18.06.2015 11:22:57.781] [Karma] [Debug] [ktaGlobal] INFO [karma]: starting karma server
[18.06.2015 11:22:57.819] [Karma] [Debug] [ktaGlobal] INFO [karma]: [SyntaxError: Unexpected token /]
[18.06.2015 11:22:57.819] [Karma] [Debug] [ktaGlobal] SyntaxError: Unexpected token /
[18.06.2015 11:22:57.819] [Karma] [Debug] [ktaGlobal]     at Object.parse (native)
[18.06.2015 11:22:57.820] [Karma] [Debug] [ktaGlobal]     at Object.readJson (C:\USERS\CCOPELM2\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\12.0\EXTENSIONS\YTJIVBEN.CL0\TestServer\TextFile.js:10:17)
[18.06.2015 11:22:57.820] [Karma] [Debug] [ktaGlobal]     at Object.<anonymous> (C:\USERS\CCOPELM2\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\12.0\EXTENSIONS\YTJIVBEN.CL0\KarmaTestServer\Start.js:14:29)
[18.06.2015 11:22:57.820] [Karma] [Debug] [ktaGlobal]     at Module._compile (module.js:460:26)
[18.06.2015 11:22:57.820] [Karma] [Debug] [ktaGlobal]     at Object.Module._extensions..js (module.js:478:10)
[18.06.2015 11:22:57.820] [Karma] [Debug] [ktaGlobal]     at Module.load (module.js:355:32)
[18.06.2015 11:22:57.821] [Karma] [Debug] [ktaGlobal]     at Function.Module._load (module.js:310:12)
[18.06.2015 11:22:57.821] [Karma] [Debug] [ktaGlobal]     at Function.Module.runMain (module.js:501:10)
[18.06.2015 11:22:57.821] [Karma] [Debug] [ktaGlobal]     at startup (node.js:129:16)
[18.06.2015 11:22:57.821] [Karma] [Debug] [ktaGlobal]     at node.js:814:3
[18.06.2015 11:22:58.072] [Karma] [Warning] [ktaGlobal] Karma stopped - exit code: 0
[18.06.2015 11:22:58.072] [Karma] [Warning] [ktaGlobal] Restarting Karma

When using my karma.conf.js on its own everything works properly. It is a very simple project with all files in the project root folder. Two typescript files. One with a class, the other with the tests for that class.

I simplified the KarmaTestAdapter.json as much as possible.

{
"$schema": "http://MortenHoustonLudvigsen.github.io/KarmaTestAdapter/KarmaTestAdapter.schema.json",
"Disabled": false
}

Interestingly, if I set Disabled to true, no exception occurs and the following is displayed in the the VS output tab [Tests].

[Karma] [Warning] [ktaGlobal] Karma is disabled in KarmaTestAdapter.json

Reading some of the other issues, I tested this against the Karma stack being installed globally in node, and had the same issue.

Originally, the karma.config.js was written in a style using a JS literal object. I changed this to a valid JSON object, and it failed with the same error.

Any ideas?

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

No branches or pull requests

1 participant