-
This Visual Studio Code extension allows you to view, run, debug, and check coverage for your Angular tests. It leverages the new vscode testing API and is inspired by the Karma Test Explorer.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
Earlier versions of test extensions were based on the test explorer API. Language-specific extensions were built on top of this UI and its adapters. The explorer UI provided the required APIs and UI, while the adapters facilitated communication between the test framework and the explorer.
-
As we are using the widely adopted istanbul to generate the coverage, vscode team already wrote a context api which translates the istanbul coverage to vscode understandable format.
-
The extension can be installed from vscode marketplace and the code can be found in github repo.
-
To capture the test execution status, I wrote a custom karma reporter(a good resource) with which I was able to emit the test execution status back to the vscode extension. I am using socket.io to do this communication.
-
We usually run Angular tests through the cli ng test which picks the default config from /node_modules/@angular-devkit/build-angular/src/webpack/plugins/karma/karma.js, runs the tests in the project/workspace context, shows the execution log in the terminal and generates coverage using istanbul.js based on custom config we defined.