Giter Site home page Giter Site logo

raagh / angular-karma_test-explorer Goto Github PK

View Code? Open in Web Editor NEW
66.0 8.0 24.0 10.61 MB

vscode extension for easy angular testing and debugging

Home Page: https://marketplace.visualstudio.com/items?itemName=raagh.angular-karma-test-explorer

License: MIT License

TypeScript 99.84% JavaScript 0.16%
angular unit-testing javascript typescript angular-cli karma vscode vscode-extension vscode-plugin testing-tools

angular-karma_test-explorer's Introduction

Angular/Karma Test Explorer for Visual Studio Code

The Angular/Karma Test Explorer extension allows you to run or debug your Angular or Karma tests with the Test Explorer UI extension on Visual Studio Code.

Example run tests

Build Status

THIS EXTENSION IS NO LONGER BEING UPDATED, PLEASE CONSIDER USING THIS

Features

  • See all angular tests in the side bar without running them.
  • Reload tests manually by the reload button in the UI.
  • Run all tests together, run set of tests, run single test and see results in the UI.
  • Shows a failed test's log when the test is selected in the explorer.
  • Block during test execution.
  • Debug tests (Please read the special notes about this feature).
  • Cancel current run (Please read the special notes about this feature).
  • Lets you choose test suites or individual tests in the explorer that should be run automatically after each file change.
  • Supports Angular CLI projects.
  • Supports standalone karma (specify "Karma" as projectType).
  • Supports non CLI Angular projects (specify "Angular" as projectType).
  • Supports multi-root workspaces(only one angular app per workspace).
  • Adds CodeLenses to your test files for starting and debugging tests.
  • Adds Gutter decorations to your test files showing the tests' state.
  • Adds line decorations to the source line where a test failed.
  • Loads values from user karma.conf.js (some get removed to make the explorer work correctly).
  • Detects configuration changes and reload tests automatically.
  • Allows configuration for different type of workflows: Angular project path, project type, karma.conf path, default project name for multiple projects inside one root.
  • Forwards the console output from Karma to a VS Code output channel(Test Explorer Logs).

How to use it?

Planned features

  • Detect file changes(workspace, new test definitions) and reload tests automatically.

What about bugs and fixes?

  • If something goes wrong you will see error logs on vscode Test Explorer Logs output channel.
  • If you find a bug or think that a feature is missing and is not in the backlog please report it using the appropiate github issue template.
  • If you wanna help out please read the contribution guidelines for this project.
  • If you have any urgent question you might wanna check our Gitter Channel for a direct chat with me or other people using the extension.

Do you like my work? Then consider becoming a Patron!

angular-karma_test-explorer's People

Contributors

future-pirate-king avatar hbenl avatar joaorenno avatar julianschwuchow avatar libinvarghese avatar lucono avatar raagh avatar s4m0r4m4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-karma_test-explorer's Issues

Add fileUri to testNodes and suiteNodes for ViewSource feature enabling

Is your feature request related to a problem? Please describe.
Problem: testNodes and suiteNodes from the karma adapter doesn't feed the fileUri from the test which prevent the "ViewSource" feature from the test explorer plugin.

Describe the solution you'd like
Since Karma doesn't provide this information, I guess a workaround would be to manually match the files by using jasmine to find all test in the angular project and then matching those with karma nodes.

Configurable "root" directory

Is your feature request related to a problem? Please describe.

I'd like to use the plugin with multi-directory workspaces (think of a project with separate "server" and "client" directories, the latter being an Angular app).

Describe the solution you'd like

The plugin should provide configuration option to set root/work directory, similar to e.g. jasmineExplorer.cwd.

Describe alternatives you've considered

Opening another VS Code window to only work on the client. Less convenient, does not match my workflow.

watch files and run relevant tests

Is your feature request related to a problem? Please describe.
The current default experience with the test runner opened in the browser is that it will re-run tests when a file gets changed - either the test file or the implementation file.
This behavior does not seem to be replicated with this awesome extension (no irony - the extension is brilliant!).
Instead I have to manually click on the "play" button to start the relevant tests.

Describe the solution you'd like
I'm wondering if there is a way to watch files changed and run the affected tests.

Describe alternatives you've considered
N/A

Additional context
N/A

Error: Configured debug type 'chrome' not supported. - Suggest adding Debugger for Chrome as possible extension

I was having trouble getting debugging to work for my Angular CLI tests that use the Karma Chrome Plugin and was getting the following error:

Configured debug type 'chrome' not supported.

The documentation seemed to suggest all I needed was this extension and perhaps the Test Explorer extension. I tried installing the Debugger for Chrome and this error went away and I was able to happily debug my tests.

Might I suggest you add this somehow to the ReadMe? I'd be happy to create something and submit a pull request for your review. Another option might be an FAQ section.

Cannot load tests in non-cli project

Describe the bug
When using it from non-cli project I cannot load the tests. The Test Explorer Logs show:

[15:03:37] INFO: Test Loading started...
[15:03:37] INFO: Listening to AngularReporter events on port 9999
[15:03:41] ERROR: stderr: (node:23652) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead

[15:03:42] INFO: Test Loading completed!

But no tests are shown.
The error regarding Tabpable.Plugin is irrelevant because running the test via a terminal works fine with this error.
I've seen #27 and this is a similar situation for my project.

settings.json:
"angularKarmaTestExplorer.projectType": "Karma",
// "angularKarmaTestExplorer.projectRootPath": "",
"angularKarmaTestExplorer.karmaConfFilePath": "karma.conf.js"

To Reproduce
I cannot upload a repro since this is a pretty complex project scenario..

Logs
Please open vscode developer tools and check the console for any errors or logs from the test explorer

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • Angular Version 6.1.9
  • Node version v10.14.2

Additional context

Normally we start tests with this npm command:
'node_modules/.bin/karma start karma.conf.js --browsers Chrome'
Its a project that uses Webpack to build the Angular project.

Didn't find any tests for at least 30 minutes

Stuck at reloading tests and dont find any tests

Logs
[12:36:41 PM] INFO: Starting Angular test enviroment for project: scc
[12:36:41 PM] INFO: Listening to AngularReporter events on port 9999

Desktop (please complete the following information):

  • OS: Ubuntu
  • Angular Version 8.3.1
  • Node versionv 10.16.2
  • karma.conf.js at root
    Screenshot from 2019-09-05 12-42-39

Project Structure
Screenshot from 2019-09-05 13-12-48

Developer Console error:
(node:4625) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

nested test cases not working not visib

issue i faced that nested test cases not showed properly.

describe('orderNumber and lineNumber validation Sync', () => {
beforeEach(() => {
});
describe('when combination exists', () => {
beforeEach(() => {

      });
      it('should have invalid states', () => {
     
      });
    });
    describe('when combination does not exist', () => {
      beforeEach(() => {
       
      });
      it('should should have valid states', () => {
      
      });
    });
    describe('when orderLine is entered', () => {
      beforeEach(() => {
 
      });
      describe('when orderNumber is not entered', () => {
        it('should have invalid state', () => {
         
        });
      });
      // The case when both are entered is handled in the test above.
    });
    describe('when orderNumber is entered', () => {
      beforeEach(() => {
      
      });
      describe('when orderLineNumber is not entered', () => {
        it('should have invalid state', () => {
         
        });
      });
    });
  });

inner nested (It) is not showing in test explorer. and because of that i m unable to debug that.

Refresh tests placement of a file when saving it

Hi here, I find your package really helpful !
But when working with it, I find something could be improved.

The problem

Usually using auto-run on one file. I modify this file, change things, add new tests.
I have a problem each time I add or remove a line. Where each test begin and end doesn't match the file anymore.
There is already a refresh in your package (I believe it refresh all placement of tests), but I need to do it manually each time, and it's taking a lot of time (at least 5 minutes on the repo I am working). Because of that problem, the auto-run is not really helpful.
If I don't refresh, the tests are fucked-up because the begin and end lines of each tests don't match the current test anymore.

Possible solution

I don't know your code and if it's possible.
But could be really cool to refresh the placement of the tests automatically when saving a file. And refresh only the placement of test in the file that is saved. And use the auto-run only after placement has been refresh if activated.

Do you think it could be possible ?
Don't hesitate if you need more details.

Thanks in advance !
Marina

projectRootPath fails to resolve into a valid path

Describe the bug
No tests are loaded because projectRootPath fails to resolve in my current environment.

To Reproduce
Not sure if it is easily reproducible outside of my local environment, but I just have to load my workspace in VSCode for the problem to happen. No errors in output log, only in console.

Logs
extensionHost.ts:294 [Extension Host] debugger listening on port 62826 mainThreadExtensionService.ts:64 [[object Object]]Cannot read property 'map' of undefined $onExtensionRuntimeError @ mainThreadExtensionService.ts:64 _doInvokeHandler @ rpcProtocol.ts:394 _invokeHandler @ rpcProtocol.ts:379 _receiveRequest @ rpcProtocol.ts:299 _receiveOneMessage @ rpcProtocol.ts:226 _protocol.onMessage.e @ rpcProtocol.ts:101 fire @ event.ts:572 fire @ ipc.net.ts:449 _receiveMessage @ ipc.net.ts:729 _socketDisposables.push._socketReader.onMessage.e @ ipc.net.ts:588 fire @ event.ts:572 acceptChunk @ ipc.net.ts:235 _register._socket.onData.e @ ipc.net.ts:196 t @ ipc.net.ts:28 emit @ events.js:182 addChunk @ _stream_readable.js:283 readableAddChunk @ _stream_readable.js:264 Readable.push @ _stream_readable.js:219 onStreamRead @ internal/stream_base_commons.js:94 mainThreadExtensionService.ts:65 TypeError: Cannot read property 'map' of undefined at new TestSuiteNode (c:\Users\joaorenno\.vscode\extensions\hbenl.vscode-test-explorer-2.14.6\out\tree\testSuiteNode.js:18:44) at TestCollection.onTestLoadEvent (c:\Users\joaorenno\.vscode\extensions\hbenl.vscode-test-explorer-2.14.6\out\tree\testCollection.js:99:34) at constructor.disposables.push.adapter.tests.testLoadEvent (c:\Users\joaorenno\.vscode\extensions\hbenl.vscode-test-explorer-2.14.6\out\tree\testCollection.js:52:67) at u.fire (c:\apps\portable\vscode\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:50:207) at registerTestAdapter.adapterSubscriptions.set.adapter.tests.event (c:\Users\joaorenno\.vscode\extensions\hbenl.vscode-test-explorer-2.14.6\out\hub\testHub.js:52:43) at u.fire (c:\apps\portable\vscode\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:50:207) at Adapter.<anonymous> (c:\Users\joaorenno\.vscode\extensions\raagh.angular-karma-test-explorer-1.2.3\out\adapter.js:72:35) at Generator.next (<anonymous>) at fulfilled (c:\Users\joaorenno\.vscode\extensions\raagh.angular-karma-test-explorer-1.2.3\node_modules\tslib\tslib.js:107:62) $onExtensionRuntimeError @ mainThreadExtensionService.ts:65 _doInvokeHandler @ rpcProtocol.ts:394 _invokeHandler @ rpcProtocol.ts:379 _receiveRequest @ rpcProtocol.ts:299 _receiveOneMessage @ rpcProtocol.ts:226 _protocol.onMessage.e @ rpcProtocol.ts:101 fire @ event.ts:572 fire @ ipc.net.ts:449 _receiveMessage @ ipc.net.ts:729 _socketDisposables.push._socketReader.onMessage.e @ ipc.net.ts:588 fire @ event.ts:572 acceptChunk @ ipc.net.ts:235 _register._socket.onData.e @ ipc.net.ts:196 t @ ipc.net.ts:28 emit @ events.js:182 addChunk @ _stream_readable.js:283 readableAddChunk @ _stream_readable.js:264 Readable.push @ _stream_readable.js:219 onStreamRead @ internal/stream_base_commons.js:94

Desktop (please complete the following information):

  • OS: Windows 10 1903
  • Angular Version: 8.2.0
  • Node version: 12.10.0
  • karma.conf.js path: app/configs/karma.conf.js

Additional context
VSCode Info:
Version: 1.38.1
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:35:15.005Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362
Single root workspace loaded from a .code-workspace file located in a different path than the project.

Extension Config:
"angularKarmaTestExplorer.projectRootPath": "app",
"angularKarmaTestExplorer.karmaConfFilePath": "configs\karma.conf.js"

Possible Solution
Looks like this bug is caused by an incorrect workspacePath in model/test-explorer-configuration.ts. The value of this constant is calculated based on the value of workspaceVSCODEPath, which in my case starts with /C:/<path-to-project>. This leading slash seems to be the problem, since the regex used here to trim it only considers lowercase drive letters.

The solution that worked in my local environment was to also consider uppercase letters in the regex. This could be done by either adding them in the capture group or using a case-insensitive search.

I also want to thank you for your work on this amazing extension, it is truly a time saver for me and my team. Wish you the best!

No Tests Found & Error on Refresh

First of all, I love this extension. Unfortunately, I cannot make it running on a larger project.

Describe the bug
I open my solution and everything starts loading. The project contains over 2000 tests. I can execute them with ng test. Here is what I see in the log:
[12:35:15 PM] INFO: Starting Angular test enviroment for project: clinician-app
[12:35:16 PM] INFO: Listening to AngularReporter events on port 9999
[12:38:08 PM] INFO: Test loading completed - No tests found

If I try to refresh the list of test I'll get the error below, which is far beyond my understanding for now.
[2:55:48 PM] ERROR: error from ng child process: Error: spawn ng ENOENT
[2:55:48 PM] INFO: AngularReporter closed connection with event: forced close
[2:55:48 PM] INFO: Starting Angular test enviroment for project: clinician-app
[2:55:48 PM] INFO: AngularReporter closed connection with event: forced close
[2:55:48 PM] INFO: Listening to AngularReporter events on port 9999
[2:55:48 PM] INFO: Angular exited succesfully
[2:55:48 PM] INFO: Starting Angular test enviroment for project: clinician-app
[2:58:40 PM] INFO: Test loading completed - No tests foun

To Reproduce
Well, I don't know how to reproduce this, first of all the project is quite large and I have no clue what could cause the problem.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
All settings of test explorer left on defaults, I was trying to play with the settings but without effect.

Angular CLI: 8.2.0
Node: 10.15.0
OS: win32 x64
Angular: 8.2.0

Additional context
I have limited experience with Angular. Making this work would be a great help.

Is Angular required to use?

Hello!
I still can't understand could this extension be used with project which doesn't use Angular?
I have a React project with tests written with Jasmine and run with Karma.
I've set project type to 'Karma', but explorer couldn't be able to find any of the tests. It just rotates 'reload icon' and nothing happens...
Once vscode showed me a notification that it can't find angular related files... (don't remember exact phrase) …despite type 'Karma' in config
Sorry if my question doubles issue #53

Error on loading, node version.

Describe the bug
When the extension tries to load, it throws an error saying that Node 8.10.0 is not compatible, while I'm using v10.16.0

To Reproduce
Just install the extension having 10.16.0 as Node version. Click on the tests tab with debug mode activated and you will see the error.

Logs

[12:14:09] INFO: Starting Angular test enviroment for project: app
[12:14:09] INFO: Using specific arguments: --code-coverage
[12:14:09] INFO: Listening to AngularReporter events on port 9999
[12:14:23] ERROR: stderr: You are running version v8.10.0 of Node.js, which is not supported by Angular CLI 8.0+.
The official Node.js version that is supported is 10.9 or greater.

Please visit https://nodejs.org/en/ to find instructions on how to update Node.js.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: ubuntu linux
  • Angular Version 7.2.15 (CLI 7.3.9)
  • Node version 10.16.0
  • karma.conf.js path karma.conf.js (default)

Karma test watchers are started but not stopped correctly

Describe the bug
More and more Karma test runners are spawned but they are never terminated.

To Reproduce
Open a few projects that contain karma tests and close them again.

Logs

 ERR listen EADDRINUSE :::9999: Error: listen EADDRINUSE :::9999
	at Server.setupListenHandle [as _listen2] (net.js:1330:14)
	at listenInCluster (net.js:1378:12)
	at Server.listen (net.js:1466:7)
	at listenTillKarmaReady.resolve (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\integration\karma-event-listener.js:47:25)
	at new Promise (<anonymous>)
	at KarmaEventListener.listenTillKarmaReady (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\integration\karma-event-listener.js:18:16)
	at AngularServer.<anonymous> (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\angular\angular-server.js:31:43)
	at Generator.next (<anonymous>)
	at __awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:107:75)
	at new Promise (<anonymous>)
	at Object.__awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:103:16)
	at AngularServer.start (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\angular\angular-server.js:24:24)
	at AngularKarmaTestExplorer.<anonymous> (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\angular-karma-test-explorer.js:24:38)
	at Generator.next (<anonymous>)
	at __awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:107:75)
	at new Promise (<anonymous>)
	at Object.__awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:103:16)
	at AngularKarmaTestExplorer.loadTests (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\angular-karma-test-explorer.js:16:24)
	at Adapter.<anonymous> (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\adapter.js:48:57)
	at Generator.next (<anonymous>)
	at __awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:107:75)
	at new Promise (<anonymous>)
	at Object.__awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:103:16)
	at Adapter.load (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\adapter.js:42:24)
	at TestHub.registerTestAdapter (D:\Users\EBHNA\.vscode\extensions\hbenl.vscode-test-explorer-2.11.0\out\hub\testHub.js:56:17)
	at Object.registerTestAdapter (D:\Users\EBHNA\.vscode\extensions\hbenl.vscode-test-explorer-2.11.0\out\main.js:68:45)
	at TestAdapterRegistrar.add (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\vscode-test-adapter-util\out\registrar.js:45:22)
	at new TestAdapterRegistrar (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\vscode-test-adapter-util\out\registrar.js:19:22)
	at D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\main.js:28:40
	at Generator.next (<anonymous>)
	at __awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:107:75)
	at new Promise (<anonymous>)
	at Object.__awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:103:16)
	at activate (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\main.js:11:20)
	at Function._callActivateOptional (d:\Users\EBHNA\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:731:936)
	at Function._callActivate (d:\Users\EBHNA\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:731:625)
	at define._doActivateExtension.Promise.all.then.e (d:\Users\EBHNA\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:730:635)

Screenshots
afbeelding

Desktop (please complete the following information):

  • OS: Windows 10 Enterprise Build 16299
  • Browser: Chrome Version 74.0.3729.157 (Official Build) (32-bit)
  • Angular Version: 7.1.0
  • Node version: 10.15.3

Activating extension 'raagh.angular-karma-test-explorer' failed: Cannot find module '..../.vscode/extensions/raagh.angular-karma-test-explorer-0.3.0/out/main.js'.

Describe the bug
I've created a new angular 7 application with the cli. Installed the plugin and reloaded vscode.
Tests won't load, so I checked the vscode console and got this error

workbench.main.js:3187 Activating extension 'raagh.angular-karma-test-explorer' failed: Cannot find module '......./.vscode/extensions/raagh.angular-karma-test-explorer-0.3.0/out/main.js'.
_logMessageInConsole @ workbench.main.js:3187

workbench.main.js:238 [Extension Host] Activating extension raagh.angular-karma-test-explorer failed: Cannot find module '...../.vscode/extensions/raagh.angular-karma-test-explorer-0.3.0/out/main.js'
t.log @ workbench.main.js:238

[Extension Host] Here is the error stack: Error: Cannot find module '....../.vscode/extensions/raagh.angular-karma-test-explorer-0.3.0/out/main.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
at Function.Module._load (internal/modules/cjs/loader.js:528:25)
at Function.define._installInterceptor.i._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:486:42)
at Function.t._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:750:857)
at Function.t.getExtensionPathIndex.then.i._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:676:176)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Function.i [as __$__nodeRequire] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:31:542)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:737:450
at I._doActivateExtension (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:737:558)
at I._activateExtension (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:736:404)
at I. (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:733:330)
at Generator.next ()
at n (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:13:388)
at new Promise ()
at n (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:13:165)
at Object.actualActivateExtension (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:733:32)
at p._activateExtension (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:474:561)
at define._activateExtensions.r.length.Promise.all.o.map.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:474:245)
at Array.map ()
at p._activateExtensions (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:474:233)
at define._activateExtensions.r.length._activateExtensions.then.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:474:330)

Desktop (please complete the following information):

  • OS: macOS 10.14.5
  • Browser chrome
  • Angular Version 7@latest
  • Node version v8.11.3

Current Implementation not working on windows (related to child_process.spawn)

Problem: the current implementation is not working on windows. child_process.spawn from node.js throws an error when trying to lunch angular by ng tests in a command line. On linux and MacOS it works fine.

On windows it works fine if you replace spawn by exec (but we cannot use this as it brings bigger problems)

Repro steps:
Clone repo with branch bugfix/not-working-on-windows
Start application on windows you will see this error in console after angular starts.

capture

Unable to debug typescript angularjs tests

Describe the bug
Because I'm testing angularjs (i.e 1.x) I'm running in 'Karma' mode and all of my tests are found and run without any issues. However, I'm running in TypeScript using the karma typescript pre-processor etc and none of my break points are being hit (they remain as an empty circle and don't go red).

To Reproduce
Here is a copy of my karma.conf.js file:

module.exports = function (config) {
  config.set({

    basePath: '',

    frameworks: ['jasmine', 'karma-typescript'],

    preprocessors: {
      '**/*.ts': ['karma-typescript'],
      '**/*.html': ['ng-html2js']
    },

    ngHtml2JsPreprocessor: {
      moduleName: "templates",
    },

    typescriptPreprocessor: {
      options: {
        sourceMap: true, // generate source maps
        noResolve: false // enforce type resolution
      },
      transformPath: function (path) {
        return path.replace(/\.ts$/, '.js');
      }
    },

    // list of files / patterns to load in the browser
       files: [
      "./app/env.ts",
      "./assets/lib/angular/angular.js",
      "./assets/lib/angular/angular-sanitize.js",
      "./assets/lib/angular/angular-ui-router.js",
      "./assets/lib/angular-animate/angular-animate.js",
      "./assets/lib/angular-translate/angular-translate.js",
      "./assets/lib/angular-translate/angular-translate-loader-url.js",
      "./assets/lib/angular-cookie/angular-cookie.js",
      "./assets/lib/angular-mocks/angular-mocks.js",
      "./assets/lib/lodash/core.js",
      "./app/controllers/**/*.ts",
      "./app/routing/**/*.ts",
      "./app/services/**/*.ts",
      "./app/shared/**/*.ts",
      "./app/**/*.html",
      "./spec/mocks/**/*.ts",
      "./spec/**/*spec.ts",
      "./app/app.ts",
    ],

    // list of files to exclude
    exclude: [],

    reporters: ["karma-typescript", "dots"],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['ChromeDebugging'],

    customLaunchers: {
      ChromeDebugging: {
        base: 'Chrome',
        flags: ['--remote-debugging-port=9333']
      }
    },
    singleRun: false,
    concurrency: Infinity
})}

Logs
There are no errors in the log.

Desktop (please complete the following information):

  • OS: Windows 10 Pro
  • Angular Version: AngularJS v1.6.6
  • Node version: 6.9.0
  • karma.conf.js path from the root folder you re opening in vscode (root path and this is set correctly).

Support Non CLI Based angular projects

Is your feature request related to a problem? Please describe.
When i try to run the unit tests for a angular project (Not cli based) , unit tests are not displayed in the explorer

Describe the solution you'd like
Provide a configurable entries so that test explorer can discover the available unit tests and display them.

Describe alternatives you've considered
no alternatives considered.

Angular 8.2.0 Library Project Not Refreshing or Running Correctly

Describe the bug
When opening an Angular library project application (an Angular app that has a library project in it), and selecting the library project from the list, the tests take a very long time to show up, and if they change, they don't always update when refreshing. Code lens for the tests is not showing up either.

To Reproduce
VS Code 1.36.1
Angular 8.2.0

Create a new Angular 8 application
Generate a new library project
Try to switch back and forth between the projects in the Test Explorer

Logs

[3:46:53 PM] INFO: Starting Angular test enviroment for project: app-angular-authentication
[3:46:53 PM] INFO: Listening to AngularReporter events on port 9999
[3:47:26 PM] ERROR: error from ng child process: Error: spawn ng ENOENT
[3:47:26 PM] INFO: AngularReporter closed connection with event: transport close
[3:47:26 PM] INFO: Angular exited succesfully
[3:47:26 PM] INFO: Starting Angular test enviroment for project: authentication
[3:47:26 PM] INFO: Listening to AngularReporter events on port 9999
[3:47:36 PM] INFO: Test loading completed - No tests found
[3:47:36 PM] INFO: AngularReporter closed connection with event: transport close
[3:47:36 PM] INFO: Starting Angular test enviroment for project: app-angular-authentication
[3:47:58 PM] INFO: Test loading completed

Desktop (please complete the following information):

  • OS: Windows Server 2016
  • Angular Version 8.2.0
  • Node version 10.9.0
  • karma.conf.js path from the root folder you re opening in vscode.
    • /karma.conf.js

Additional context
"jasmine-core": "~3.4.0"
"jasmine-spec-reporter": "~4.2.1"
"karma": "~4.1.0"
"karma-chrome-launcher": "~2.2.0"
"karma-coverage-istanbul-reporter": "~2.0.1"
"karma-jasmine": "~2.0.1"
"karma-jasmine-html-reporter": "^1.4.0"

Test Explorer Logs - Minimal Output

Using the latest version (v1.2.0) I was confused why I was no longer getting any output aside from Success or Failure from the Test Explorer Logs. I thought it may have been something to do with my karma.conf logging level, but after trying debug and info without any changes, I decided to try an older version.

I manually downgraded to v1.1.0, which generates an output including error(s) and stack traces.

Use local version of Angular CLI instead of Global

Thank you for this awesome extension.


I usually don't install global binaries on my system (I try to resist as much as I can). So, whenever I have to bootstrap new angular project, I do

> npx @angular/cli@next new dream-app

Since I don't have @angular/cli globally installed, the extension failed. Looking into the source code, I realized we look for ng binary.

  runNgTest() {
    const cliArgs = ["test", `--karma-config="${require.resolve(this.baseKarmaConfigFilePath)}"`];
    this.logger.log(`Starting Angular tests with arguments: ${cliArgs.join(" ")}`);
    const options = {
      cwd: this.angularProjectRootPath,
      shell: true,
    };
    this.angularProcess = spawn("ng", cliArgs, options);
    this.angularProcess.stderr.on("data", data => this.logger.log(`stderr: ${data}`));
  }

I saw VSCode variables list on docs site

${workspaceFolder} - the path of the folder opened in VS Code

Can we use @angular/cli inside workspace folder before looking for global @angular/cli? And also provide error dialog if ng command is not found.

Support automated test creation system

@Raagh Okay I found out the issue. We created internally a decorator system to create jasmine test using classes. For example:

@TestSuite('MyTestSuite')
export class MyTestSuite {
  @BeforeEach()
  public beforeEach() {
  }
 
  @Test()
  public async someTest() {
  }
}

will generate a suite with the name MyTestSuite and the someTest test

Looking at your code, I think you match the files content to find the test matching those files. Having a way to configure the regex to match these decorator for me would be wonderful.

Originally posted by @plchampigny in #35 (comment)

Not being able to load tests multiple times

Problem: after tests are loaded, if you try to load them again, the ng process is killed and then after starting it again it gets stuck.

Reproduce:
Wait till all tests are loaded, click the circle arrow again. New ng process just keeps waiting forever
screenshot 2019-02-23 at 22 21 12

EXTRA INFO: the problem is related to the fact that I still dont know the real event sent when the karma server is ready for running karma run. I am currently listening to browser_connected in the karma event listener. this event is sent by the browser by in reality this happens multiple times and its not an accurate indicator. I need to figure out the correct event so KarmaHelper.waitTillServerReady waits for the correct event to resolve.

Can new test auto reload?

Ask the question
Thanks for your project!
I saw README have Detect file changes(workspace, new test definitions) and reload tests automatically.
So i think new test can auto reload. But when i create newit() in spec file, test explorer UI don't auto change. I need click reload tests, then will cause reload whole project, but this will spend lots time for my project.

So my questions is does i doing something wrong or this is expected?

Additional context
N/A

Duplicate test suites in multi project workspaces

Describe the bug
Test suites are duplicated as many times as there are folders opened in a multi project workspace.

To Reproduce
https://github.com/GoGoris/code-karma-test-explorer-bug-duplicate-tests

  1. Open workspace duplicate-tests/duplicate-tests.workspace
  2. npm install
  3. Reopen workspace and check tests in test explorer

Logs

	at Server.setupListenHandle [as _listen2] (net.js:1330:14)
	at listenInCluster (net.js:1378:12)
	at Server.listen (net.js:1466:7)
	at listenTillKarmaReady.resolve (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\integration\karma-event-listener.js:47:25)
	at new Promise (<anonymous>)
	at KarmaEventListener.listenTillKarmaReady (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\integration\karma-event-listener.js:18:16)
	at AngularServer.<anonymous> (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\angular\angular-server.js:31:43)
	at Generator.next (<anonymous>)
	at __awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:107:75)
	at new Promise (<anonymous>)
	at Object.__awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:103:16)
	at AngularServer.start (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\angular\angular-server.js:24:24)
	at AngularKarmaTestExplorer.<anonymous> (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\angular-karma-test-explorer.js:24:38)
	at Generator.next (<anonymous>)
	at __awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:107:75)
	at new Promise (<anonymous>)
	at Object.__awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:103:16)
	at AngularKarmaTestExplorer.loadTests (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\angular-karma-test-explorer.js:16:24)
	at Adapter.<anonymous> (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\adapter.js:48:57)
	at Generator.next (<anonymous>)
	at __awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:107:75)
	at new Promise (<anonymous>)
	at Object.__awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:103:16)
	at Adapter.load (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\adapter.js:42:24)
	at TestHub.registerTestAdapter (D:\Users\EBHNA\.vscode\extensions\hbenl.vscode-test-explorer-2.11.0\out\hub\testHub.js:56:17)
	at Object.registerTestAdapter (D:\Users\EBHNA\.vscode\extensions\hbenl.vscode-test-explorer-2.11.0\out\main.js:68:45)
	at TestAdapterRegistrar.add (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\vscode-test-adapter-util\out\registrar.js:45:22)
	at new TestAdapterRegistrar (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\vscode-test-adapter-util\out\registrar.js:19:22)
	at D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\main.js:28:40
	at Generator.next (<anonymous>)
	at __awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:107:75)
	at new Promise (<anonymous>)
	at Object.__awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:103:16)
	at activate (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\main.js:11:20)
	at Function._callActivateOptional (d:\Users\EBHNA\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:731:936)
	at Function._callActivate (d:\Users\EBHNA\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:731:625)
	at define._doActivateExtension.Promise.all.then.e (d:\Users\EBHNA\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:730:635)
workbench.main.js:238 [Extension Host] [11:20:04] INFO: Test Loading completed!

Screenshots
If applicable, add screenshots to help explain your problem.
afbeelding

Desktop (please complete the following information):

  • OS: Window 10
  • Browser: Chrome v74
  • Angular Version 7.1.0
  • Node version: 10.15.3

Additional context
Plugin version: 0.2.1

Debugging tests

Is your feature request related to a problem? Please describe.
Right now the debug test feature is not implemented.

Describe the solution you'd like
Be able to debug a test directly by clicking the debug button

Describe alternatives you've considered
Manually do it

Test is not loaded in VScode Version 1.37.0

The Test Explorer could not load Angular tests

  1. Install the latest version of VSCode: 1.37.0
  2. Open Angular project and wait for tests to show up in Test Explorer.

System:
Version: 1.37.0 (user setup)
Commit: 036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8
Date: 2019-08-08T02:33:50.993Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362

Console:
workbench.main.js:sourcemap:242 [Extension Host] [10:36:53 AM] ERROR: error from ng child process: Error: spawn ng ENOENT workbench.main.js:sourcemap:242 [Extension Host] [10:36:53 AM] INFO: AngularReporter closed connection with event: transport close workbench.main.js:sourcemap:242 [Extension Host] [10:36:53 AM] INFO: Angular exited succesfully workbench.main.js:sourcemap:242 [Extension Host] [10:36:53 AM] INFO: Starting Angular test enviroment for project: ui-cloud-lab workbench.main.js:sourcemap:242 [Extension Host] [10:36:53 AM] INFO: Listening to AngularReporter events on port 9999 workbench.main.js:sourcemap:242 [Extension Host] [10:37:31 AM] INFO: Test loading completed - No tests found

Thanks.

Is the library type Angular project compatible with this extension for now?

Hello Raagh
I am very glad to find out this extension in the marketplace!
And couldn't wait to use this in my project!
My project includes "application level app" and "library level apps" (nested in the application project)
I found it works fine with my AngularCLI project in the application level (can load the tests correctly)
However, something goes wrong when it comes to library level (complete test loading but didn't find one...)

After looking into the issues history for this repository
I found a comment said that Angular library is not supported yet, the timepoint is April, 11th
#21

So just want to find out whether this feature is enabled or not
Appreciate for any comments!, thanks!

Reload Tests not working

Since we went back to spawn and there is not an ipc there anymore(now using socket.io) the kill process when we try to stop karma and load it again is not working.

Reproduce: launch test explorer, wait till tests are loaded, hit the reload button, nothing happens

ERROR

rejected promise not handled within 1 second: Error: kill ESRCH
extensionHostProcess.js:700
stack trace: Error: kill ESRCH
extensionHostProcess.js:700
at process.kill (internal/process.js:186:13)
at AngularServer. (/Users/pferraggi/Documents/GitHub/angular-test-explorer/src/workers/angular/angular-server.ts:23:15)
at Generator.next ()
at __awaiter (/Users/pferraggi/Documents/GitHub/angular-test-explorer/node_modules/tslib/tslib.js:107:75)
at new Promise ()
at Object.__awaiter (/Users/pferraggi/Documents/GitHub/angular-test-explorer/node_modules/tslib/tslib.js:103:16)
at AngularServer.stopPreviousRun (/Users/pferraggi/Documents/GitHub/angular-test-explorer/out/workers/angular/angular-server.js:17:24)
at AngularTestExplorer. (/Users/pferraggi/Documents/GitHub/angular-test-explorer/src/angular-test-explorer.ts:23:32)
at Generator.next ()
at __awaiter (/Users/pferraggi/Documents/GitHub/angular-test-explorer/node_modules/tslib/tslib.js:107:75)
at new Promise ()
at Object.__awaiter (/Users/pferraggi/Documents/GitHub/angular-test-explorer/node_modules/tslib/tslib.js:103:16)
at AngularTestExplorer.loadTests (/Users/pferraggi/Documents/GitHub/angular-test-explorer/out/angular-test-explorer.js:16:24)
at ExampleAdapter. (/Users/pferraggi/Documents/GitHub/angular-test-explorer/src/adapter.ts:47:49)
at Generator.next ()
at __awaiter (/Users/pferraggi/Documents/GitHub/angular-test-explorer/node_modules/tslib/tslib.js:107:75)
at new Promise ()
at Object.__awaiter (/Users/pferraggi/Documents/GitHub/angular-test-explorer/node_modules/tslib/tslib.js:103:16)
at ExampleAdapter.load (/Users/pferraggi/Documents/GitHub/angular-test-explorer/out/adapter.js:31:24)
at TestAdapterDelegate.load (/Users/pferraggi/.vscode/extensions/hbenl.vscode-test-explorer-2.6.0/out/hub/testAdapterDelegate.js:19:29)
at TestExplorer.reload (/Users/pferraggi/.vscode/extensions/hbenl.vscode-test-explorer-2.6.0/out/testExplorer.js:70:36)
at registerCommand (/Users/pferraggi/.vscode/extensions/hbenl.vscode-test-explorer-2.6.0/out/main.js:18:64)
at d._executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:457:160)
at d.$executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:457:534)
at h._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:593:118)
at h._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:592:777)
at h._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:591:436)
at h._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:590:279)
at define.constructor._protocol.onMessage.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:588:565)
at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:43:254)
at e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:39:64)
at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:43:254)
at s (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:168:754)
at Socket.define.constructor._socketDataListener.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:168:960)
at Socket.emit (events.js:182:13)
at Socket.EventEmitter.emit (domain.js:442:20)
at addChunk (_stream_readable.js:279:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at Pipe.onread (net.js:636:20)

The error happens in the method AngularServer.stopPreviousRun

Tests are not found in new project created with angular cli

This may be issue with documentation as well, it does not describe steps required to make tests show up in explorer.

Ask the question

  1. create new app with ng new app
  2. have installed both "Test Explorer UI" and "Angular/Karma Test Explorer"
  3. restart vs code
  4. follow the documentation: e.g. open test explorer and click "run"
    result: nothing happens

expected:
to have documentation describing what to do at least for default generated angular cli projects

Additional context
OS: Windows 10
"@angular/cli": "~8.3.5",

Karma stops listening to port after a few tries.

Problem: When I try to karma run after few tries it stops working and karma returns "There is no server listening on port 9876"

Reproduce: Start the application as it is defined in the README. wait till tests are loaded in the test UI on the angular project. Click play button and wait for results. Repeat it 3 times. after the third one it will stop abruptly and return the mentioned error.

Test branch: feature/run-tests

0-nzrioqbqdgdvooxtujpq

Test reloader spins indefinitely

Hi,

Trying to load my karma tests, the loading indicator is spinning indefinitely.

Are there logs I can access somewhere, or something I can do to work out what it's doing?

Alex

ERR Cannot read property 'map' of undefined

Describe the bug
After installing the extension nothing happens. The following error is visible in the developer tools.
Do I need to install any dependencies?

Logs

ERR Cannot read property 'map' of undefined: TypeError: Cannot read property 'map' of undefined
	at new TestSuiteNode (D:\Users\EBHNA\.vscode\extensions\hbenl.vscode-test-explorer-2.10.0\out\tree\testSuiteNode.js:16:40)
	at TestCollection.onTestLoadEvent (D:\Users\EBHNA\.vscode\extensions\hbenl.vscode-test-explorer-2.10.0\out\tree\testCollection.js:84:34)
	at constructor.disposables.push.adapter.tests.testLoadEvent (D:\Users\EBHNA\.vscode\extensions\hbenl.vscode-test-explorer-2.10.0\out\tree\testCollection.js:47:67)
	at u.fire (d:\Users\EBHNA\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
	at registerTestAdapter.adapterSubscriptions.set.adapter.tests.event (D:\Users\EBHNA\.vscode\extensions\hbenl.vscode-test-explorer-2.10.0\out\hub\testHub.js:52:43)
	at u.fire (d:\Users\EBHNA\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:44:708)
	at Adapter.<anonymous> (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\adapter.js:49:31)
	at Generator.next (<anonymous>)
	at fulfilled (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:104:62)

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser N/A
  • Angular Version 7.1.4
  • Node version 10.15.3

Test Explorer parses tests endlessly

Describe the bug
The Test Explorer does not recognize the project properly. The Test Explorer seems to endlessly parse for the project's tests.

To Reproduce
🤔

Logs
no logs :(

Screenshots
Bildschirmfoto 2019-07-12 um 08 54 29

Desktop (please complete the following information):

  • Test Explorer UI: 2.12.1

  • Angular/Karma TEst Explorer: 1.0.3

  • OS: macOS Mojave 10.14.5

  • Angular Version:
    "@angular/core": "~8.1.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",

  • Node version: v11.15.0

  • VS Code: Version 1.36.1 (1.36.1)

  • karma.conf.js path from the root folder you re opening in vscode: ./src/karma.conf.js

Context

might be related to #21

Viewing the tested components

Currently in an AngularCLI generated project, running the test opens the Karma runner in an isolated browser context and runs the test, with each test showing the component alongside the tests. Is there a way to run the tests using this plugin and viewing these components in a browser window too? I can go to localhost:9876 with the normal configuration and it opens the runner, but there is no list of tests or the previously compiled components.

Angular/karma test explorer - The Angular version you re using is not supported, please update to Angular 6+

Hello Raagh,

I have installed Angular/Karma test explorer in visual studio code and it was working fine till last week. I'm getting this error now 'The Angular version you re using is not supported, please update to Angular 6+'.

Please find my CLI version details below,

Angular CLI: 7.0.3
Node: 8.12.0
OS: win32 x64
Angular:
...

Package Version

@angular-devkit/architect 0.10.3
@angular-devkit/core 7.0.3
@angular-devkit/schematics 7.0.3
@schematics/angular 7.0.3
@schematics/update 0.10.3
rxjs 6.3.3
typescript 3.1.3

Thank you for your support in advance.

Indefinite 'Reloading Tests'

Describe the bug
Same situations as #42 - Test Explorer just in a state of perpetual 'reloading tests'

To Reproduce
Open project, open Test Explorer

Logs
[2019-08-02 09:47:21.630] [renderer1] [error] listen EACCES 0.0.0.0:8888: Error: listen EACCES 0.0.0.0:8888
at Server.setupListenHandle [as _listen2] (net.js:1269:19)
at listenInCluster (net.js:1334:12)
at Server.listen (net.js:1421:7)
at exports.modules.Array.concat.Promise (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\1.main.js:199945:12)
at new Promise ()
at getAvailablePort (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\1.main.js:199941:37)
at exports.modules.Array.concat.module.exports (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\1.main.js:199965:26)
at startServer (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\2.main.js:27:24)
at Promise.all.then.then (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\main.js:1767:18)
[2019-08-02 09:47:23.881] [renderer1] [error] listen EACCES 0.0.0.0:9999: Error: listen EACCES 0.0.0.0:9999
at Server.setupListenHandle [as _listen2] (net.js:1269:19)
at listenInCluster (net.js:1334:12)
at Server.listen (net.js:1421:7)
at listenTillKarmaReady.resolve (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\integration\karma-event-listener.js:52:25)
at new Promise ()
at KarmaEventListener.listenTillKarmaReady (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\integration\karma-event-listener.js:19:16)
at AngularServer. (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular\angular-server.js:34:43)
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at AngularServer.start (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular\angular-server.js:27:24)
at AngularKarmaTestExplorer. (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular-karma-test-explorer.js:20:35)
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at AngularKarmaTestExplorer.loadTests (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular-karma-test-explorer.js:13:24)
at Adapter. (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\adapter.js:57:56)
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at Adapter.load (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\adapter.js:50:24)
at TestHub.registerTestAdapter (C:\Users\mahida.turgana.vscode\extensions\hbenl.vscode-test-explorer-2.14.0\out\hub\testHub.js:56:17)
at Object.registerTestAdapter (C:\Users\mahida.turgana.vscode\extensions\hbenl.vscode-test-explorer-2.14.0\out\main.js:69:45)
at TestAdapterRegistrar.add (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\vscode-test-adapter-util\out\registrar.js:45:22)
at new TestAdapterRegistrar (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\vscode-test-adapter-util\out\registrar.js:19:22)
at C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\main.js:27:40
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at activate (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\main.js:12:20)
at Function._callActivateOptional (c:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:748:518)
at Function._callActivate (c:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:748:207)
at define._doActivateExtension.Promise.all.then.e (c:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:747:245)
[2019-08-02 09:49:24.958] [renderer1] [error] Invalid guestInstanceId: null: Error: Invalid guestInstanceId: null
at Object.getGuestForWebContents (C:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\electron.asar\browser\guest-view-manager.js:430:11)
at C:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\electron.asar\browser\rpc-server.js:449:34
at EventEmitter.ipcMain.on.args (C:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\electron.asar\browser\rpc-server.js:278:21)
at EventEmitter.emit (events.js:182:13)
at WebContents. (C:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\electron.asar\browser\api\web-contents.js:370:21)
at WebContents.emit (events.js:182:13)
[2019-08-02 09:49:48.776] [renderer1] [error] listen EACCES 0.0.0.0:8888: Error: listen EACCES 0.0.0.0:8888
at Server.setupListenHandle [as _listen2] (net.js:1269:19)
at listenInCluster (net.js:1334:12)
at Server.listen (net.js:1421:7)
at exports.modules.Array.concat.Promise (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\1.main.js:199945:12)
at new Promise ()
at getAvailablePort (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\1.main.js:199941:37)
at exports.modules.Array.concat.module.exports (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\1.main.js:199965:26)
at startServer (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\2.main.js:27:24)
at Promise.all.then.then (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\main.js:1767:18)
[2019-08-02 09:49:49.558] [renderer1] [error] listen EACCES 0.0.0.0:9999: Error: listen EACCES 0.0.0.0:9999
at Server.setupListenHandle [as _listen2] (net.js:1269:19)
at listenInCluster (net.js:1334:12)
at Server.listen (net.js:1421:7)
at listenTillKarmaReady.resolve (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\integration\karma-event-listener.js:52:25)
at new Promise ()
at KarmaEventListener.listenTillKarmaReady (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\integration\karma-event-listener.js:19:16)
at AngularServer. (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular\angular-server.js:34:43)
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at AngularServer.start (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular\angular-server.js:27:24)
at AngularKarmaTestExplorer. (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular-karma-test-explorer.js:20:35)
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at AngularKarmaTestExplorer.loadTests (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular-karma-test-explorer.js:13:24)
at Adapter. (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\adapter.js:57:56)
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at Adapter.load (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\adapter.js:50:24)
at TestHub.registerTestAdapter (C:\Users\mahida.turgana.vscode\extensions\hbenl.vscode-test-explorer-2.14.0\out\hub\testHub.js:56:17)
at Object.registerTestAdapter (C:\Users\mahida.turgana.vscode\extensions\hbenl.vscode-test-explorer-2.14.0\out\main.js:69:45)
at TestAdapterRegistrar.add (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\vscode-test-adapter-util\out\registrar.js:45:22)
at new TestAdapterRegistrar (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\vscode-test-adapter-util\out\registrar.js:19:22)
at C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\main.js:27:40
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at activate (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\main.js:12:20)
at Function._callActivateOptional (c:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:748:518)
at Function._callActivate (c:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:748:207)
at define._doActivateExtension.Promise.all.then.e (c:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:747:245)
[2019-08-02 11:41:10.970] [renderer1] [error] listen EACCES 0.0.0.0:8888: Error: listen EACCES 0.0.0.0:8888
at Server.setupListenHandle [as _listen2] (net.js:1269:19)
at listenInCluster (net.js:1334:12)
at Server.listen (net.js:1421:7)
at exports.modules.Array.concat.Promise (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\1.main.js:199945:12)
at new Promise ()
at getAvailablePort (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\1.main.js:199941:37)
at exports.modules.Array.concat.module.exports (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\1.main.js:199965:26)
at startServer (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\2.main.js:27:24)
at Promise.all.then.then (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\main.js:1767:18)
[2019-08-02 11:41:12.650] [renderer1] [error] listen EACCES 0.0.0.0:9999: Error: listen EACCES 0.0.0.0:9999
at Server.setupListenHandle [as _listen2] (net.js:1269:19)
at listenInCluster (net.js:1334:12)
at Server.listen (net.js:1421:7)
at listenTillKarmaReady.resolve (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\integration\karma-event-listener.js:52:25)
at new Promise ()
at KarmaEventListener.listenTillKarmaReady (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\integration\karma-event-listener.js:19:16)
at AngularServer. (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular\angular-server.js:34:43)
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at AngularServer.start (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular\angular-server.js:27:24)
at AngularKarmaTestExplorer. (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular-karma-test-explorer.js:20:35)
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at AngularKarmaTestExplorer.loadTests (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular-karma-test-explorer.js:13:24)
at Adapter. (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\adapter.js:57:56)
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at Adapter.load (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\adapter.js:50:24)
at TestHub.registerTestAdapter (C:\Users\mahida.turgana.vscode\extensions\hbenl.vscode-test-explorer-2.14.0\out\hub\testHub.js:56:17)
at Object.registerTestAdapter (C:\Users\mahida.turgana.vscode\extensions\hbenl.vscode-test-explorer-2.14.0\out\main.js:69:45)
at TestAdapterRegistrar.add (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\vscode-test-adapter-util\out\registrar.js:45:22)
at new TestAdapterRegistrar (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\vscode-test-adapter-util\out\registrar.js:19:22)
at C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\main.js:27:40
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at activate (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\main.js:12:20)
at Function._callActivateOptional (c:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:748:518)
at Function._callActivate (c:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:748:207)
at define._doActivateExtension.Promise.all.then.e (c:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:747:245)
[2019-08-02 12:29:39.736] [renderer1] [error] listen EACCES 0.0.0.0:8888: Error: listen EACCES 0.0.0.0:8888
at Server.setupListenHandle [as _listen2] (net.js:1269:19)
at listenInCluster (net.js:1334:12)
at Server.listen (net.js:1421:7)
at exports.modules.Array.concat.Promise (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\1.main.js:199945:12)
at new Promise ()
at getAvailablePort (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\1.main.js:199941:37)
at exports.modules.Array.concat.module.exports (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\1.main.js:199965:26)
at startServer (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\2.main.js:27:24)
at Promise.all.then.then (C:\Users\mahida.turgana.vscode\extensions\nrwl.angular-console-8.0.10\main.js:1767:18)
[2019-08-02 12:29:40.732] [renderer1] [error] listen EACCES 0.0.0.0:9999: Error: listen EACCES 0.0.0.0:9999
at Server.setupListenHandle [as _listen2] (net.js:1269:19)
at listenInCluster (net.js:1334:12)
at Server.listen (net.js:1421:7)
at listenTillKarmaReady.resolve (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\integration\karma-event-listener.js:52:25)
at new Promise ()
at KarmaEventListener.listenTillKarmaReady (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\integration\karma-event-listener.js:19:16)
at AngularServer. (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular\angular-server.js:34:43)
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at AngularServer.start (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular\angular-server.js:27:24)
at AngularKarmaTestExplorer. (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular-karma-test-explorer.js:20:35)
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at AngularKarmaTestExplorer.loadTests (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\core\angular-karma-test-explorer.js:13:24)
at Adapter. (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\adapter.js:57:56)
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at Adapter.load (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\adapter.js:50:24)
at TestHub.registerTestAdapter (C:\Users\mahida.turgana.vscode\extensions\hbenl.vscode-test-explorer-2.14.0\out\hub\testHub.js:56:17)
at Object.registerTestAdapter (C:\Users\mahida.turgana.vscode\extensions\hbenl.vscode-test-explorer-2.14.0\out\main.js:69:45)
at TestAdapterRegistrar.add (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\vscode-test-adapter-util\out\registrar.js:45:22)
at new TestAdapterRegistrar (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\vscode-test-adapter-util\out\registrar.js:19:22)
at C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\main.js:27:40
at Generator.next ()
at __awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:107:75)
at new Promise ()
at Object.__awaiter (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\node_modules\tslib\tslib.js:103:16)
at activate (C:\Users\mahida.turgana.vscode\extensions\raagh.angular-karma-test-explorer-1.1.0\out\main.js:12:20)
at Function._callActivateOptional (c:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:748:518)
at Function._callActivate (c:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:748:207)
at define._doActivateExtension.Promise.all.then.e (c:\Users\mahida.turgana\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:747:245)

Desktop (please complete the following information):

  • OS: Windows 10
  • Angular Version 8.0.0
  • Node version 12.3.1
  • karma.conf.js path: src/karma.conf.js

Extension seems to require port 9999 to be free, wasn't given any indication to that. Any chance this is configurable and I can simply adjust it?

Problem while loading test

Describe the bug
No tests are loaded. I had to show vscode debugger (CTRL+Shift+I) to find out the source of the issue

To Reproduce
I cannot upload a project to reproduce the issue. Hopefully the trace will indicate you the source

Logs
ERR The "path" argument must be of type string. Received type undefined: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
at assertPath (path.js:39:11)
at Object.join (path.js:432:7)
at SpecResponseToTestSuiteInfoMapper.createTest (C:\Users\Cactus.vscode\extensions\raagh.angular-karma-test-explorer-1.0.1\out\core\test-explorer\spec-response-to-test-suite-info.mapper.js:67:24)
at SpecResponseToTestSuiteInfoMapper.map (C:\Users\Cactus.vscode\extensions\raagh.angular-karma-test-explorer-1.0.1\out\core\test-explorer\spec-response-to-test-suite-info.mapper.js:18:18)
at KarmaEventListener.getLoadedTests (C:\Users\Cactus.vscode\extensions\raagh.angular-karma-test-explorer-1.0.1\out\core\integration\karma-event-listener.js:54:38)
at KarmaRunner. (C:\Users\Cactus.vscode\extensions\raagh.angular-karma-test-explorer-1.0.1\out\core\karma\karma-runner.js:19:44)
at Generator.next ()
at fulfilled (C:\Users\Cactus.vscode\extensions\raagh.angular-karma-test-explorer-1.0.1\node_modules\tslib\tslib.js:104:62)

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Angular CLI: 8.0.3
Node: 12.6.0
OS: win32 x64
Angular: 8.0.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, material-moment-adapter
... platform-browser, platform-browser-dynamic, router
... service-worker

Package Version

@angular-devkit/architect 0.800.3
@angular-devkit/build-angular 0.800.3
@angular-devkit/build-optimizer 0.800.3
@angular-devkit/build-webpack 0.800.3
@angular-devkit/core 8.0.3
@angular-devkit/schematics 8.0.3
@angular/cli 8.0.3
@angular/flex-layout 7.0.0-beta.23
@ngtools/webpack 8.0.3
@schematics/angular 7.3.4
@schematics/update 0.800.3
rxjs 6.5.2
typescript 3.4.5
webpack 4.30.0

Additional context
Problem seems to be related to missing information in the createTest and createSuite method, I tried to patch it by doing:
if (this.projectRootPath == null || specComplete.filePath == null) return;

but it still explodes from elsewhere. Don't know if its related to my karma/jasmine version
I also tried upgrading node from 10.16.0 to 12.6.0 and it is still exploding.
Having more logs or feedback would be usefull, the plugin seems to be loading even if it has failed.

Allow custom karma.config.js configurations.

Currently, the tests are run with a hardcoded command to open a headless browser. It would be a nice feature to have to extend current configurations with user defined configurations to allow other ways of opening the test runner next to running the test inside Virtual Studio Code. One use-case is to use the plugin to select individual tests to run, but have a custom configuration that opens Chrome (so not headless) and show the running tests there too, including the compiled components as it is created in the unit test, allowing for isolated Test Driven Development.

Tests never show up in Test Explorer, stuck at spinning 'reloading tests'

Describe the bug
Test Explorer never shows the list of tests. The Test Explorer toolbar shows the spinner spinning with 'reloading tests' status.

To Reproduce
This happens on my real project: Angular 8 (upgraded from 7), CLI based, angular app and single component library project using ng-packagr) but it also happens on a brand new project generated with angular cli (8.2).

This is on Ubuntu 19.04 and I'm running VS Code and Chromium via snap. From the command-line, running ng test works as expected, 3 tests from default cli project pass.

On the test project, the only change I made from the output of ng new (yes to routing, scss for styles) was to modify karma.conf.js to use Chromium instead of Chrome: browsers: ['Chromium'],

Logs

Test Explorer Log

[10:02:05 AM] INFO: Starting Angular test enviroment for project: ngt
[10:02:05 AM] INFO: Listening to AngularReporter events on port 9999
[10:02:09 AM] INFO: AngularReporter closed connection with event: transport error

lsof -i :9999

COMMAND   PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
code    40551  me  140u  IPv6 4426147      0t0  TCP *:9999 (LISTEN)

VS Code Developer Tools

[Extension Host] [10:02:09 AM] INFO: AngularReporter closed connection with event: transport error console.ts:134
[Extension Host] Error: Unexpected SIGPIPE	at process.on (/snap/code/11/usr/share/code/resources/app/out/bootstrap.js:5:192)	at process.emit (events.js:182:13)
t.log @ console.ts:134
$logExtensionHostMessage @ mainThreadConsole.ts:38
_doInvokeHandler @ rpcProtocol.ts:394
_invokeHandler @ rpcProtocol.ts:379
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
_protocol.onMessage.e @ rpcProtocol.ts:101
fire @ event.ts:558
a @ ipc.net.ts:421
e @ ipc.net.ts:428
fire @ event.ts:558
_receiveMessage @ ipc.net.ts:715
S._socketDisposables.push._socketReader.onMessage.e @ ipc.net.ts:578
fire @ event.ts:558
acceptChunk @ ipc.net.ts:236
_register._socket.onData.e @ ipc.net.ts:197
t @ ipc.net.ts:28
emit @ events.js:182
addChunk @ _stream_readable.js:283
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onStreamRead @ internal/stream_base_commons.js:94

Desktop (please complete the following information):

  • OS: ubuntu 19.04
  • Angular Version 8.2.0
  • Node version 12.7.0
  • karma.conf.js path from the root folder you're opening in vscode: /home/me/code/junk/ngt/karma.conf.js

Additional context
One other oddness, in my real project, if I try to switch to the component library, the extension throws an error in the VS Code Dev Tools, complaining that port 9999 is in use. As though the extension doesn't know that it already started a listener on 9999 for my main angular app. Maybe this info helps narrow down when the error is occurring?

"npx not found" when loading tests

Describe the bug

On startup, the extension logs the following:

[13:43:04] INFO: Test Loading started...
[13:43:04] INFO: Starting Angular test enviroment for project: jasmine-config
[13:43:04] INFO: Listening to AngularReporter events on port 9999
[13:43:04] ERROR: stderr: /bin/sh: 1: npx: not found
  • and no tests are shown in the explorer view

Logs
Same error as above is visible in the console.

Desktop (please complete the following information):

  • OS: Code running on Windows 10, using remote SSH extension (ms-vscode-remote.remote-ssh) to run the language server and extensions on an Ubuntu box
  • Browser [e.g. chrome, safari] n/a
  • Angular Version [eg. 6.0.1] 7.3
  • Node version [eg. 6.0.1]11.15

npx is present:

$which npx
/home/ubuntu/.nvm/versions/node/v11.15.0/bin/npx

npx and node are both managed by nvm, so perhaps the problem is that nvm isn't being loaded when code runs whatever shell script is looking for it?

Memory problem in big projects

Describe the bug
The test-explorer never finishes loading (spinning refresh button; not showing any tests).
After a long time (~15 minutes in my case) you get this error message:
image

To run our test regularly we had to modify the ng test with a custom script in the package.json:

"test": "node --max_old_space_size=4000 ./node_modules/@angular/cli/bin/ng test",

To Reproduce
Can't really help here, sorry.
Create a project that needs more than the default memory to run tests.

Logs
Please open vscode developer tools and check the console for any errors or logs from the test explorer

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Angular Version 7.2.15
  • Node version 10.12.0
  • karma.conf.js path from the root folder you re opening in vscode: ./karma.conf.js

Change UI color to reflect test outcome

I would like to propose the idea of recoloring the UI according to test outcome.

This could be especially handy once "Detect File Changes and reload tests automatically" is implemented which does not force me to open the Test Explorer. This way I could write tests first, then fix them until the color changes back to normal.

One or more tests fail

The UI changes it's color to reflect the failing tests. (Here I only changed the status bar)

Bildschirmfoto 2019-07-12 um 16 30 21

All Tests pass

The UI returns to the original color (in this case set to green with https://marketplace.visualstudio.com/items?itemName=johnpapa.vscode-peacock)

Bildschirmfoto 2019-07-12 um 16 26 55

Empty test explorer when using hybrid app

Hi,

thank you for developing this great extension! I am trying to load my karma tests of a hybrid app (Angular CLI with embedded Angular 7 and AngularJS 1.5) which does not work since the list in the test explorer keeps empty. Did not get any debug output from the extension, neither in the output panel nor anywhere else. Tried to use the setting

"angularKarmaExplorer.logpanel": true

but that doesn't change anything. Any thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.