Support mutation testing with angular cli
See original GitHub issueWe’re investigating the possibility of supporting angular in Stryker, a mutation testing framework. I was wondering if it was possible to run test with ng test --watch=false --single-run=false
and keep open the karma server so we can fire karma run
commands.
The idea would be that we make small code changes and rerun the tests with karma run
. Ideally we would be able to distinguish between a failed test and a compile error.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:25 (23 by maintainers)
Top Results From Across the Web
How Angular Supports Mutation Testing With Example
Run the following command to configure the Angular project with the Stryker mutation testing framework. To do so, please move into your ...
Read more >Angular - Stryker Mutator
Stryker 4.0 and higher supports Angular projects using the Angular CLI starting ... checker to increase mutation testing performance and kill mutants that ......
Read more >Mutation Testing(>Coverage) — Typescript Angular — Mocha ...
Mutation testing the way to evaluate code strength, test alert against code changes, see the meaning to the unit test cases and omit...
Read more >mutation-testing-elements - npm
The mutation test report supports the following features: Calculates and displays the mutation score and other metrics
Read more >Testing – Angular - GraphQL Code Generator
The apollo-angular/testing module exports a ApolloTestingModule module and ApolloTestingController service which simplifies the testing of ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Heya @nicojs, I think that would be a nice addition, yes. We’ve recently added another binary as an API too in https://github.com/angular/angular-cli/pull/12022. I’d ask you to use roughly the same approach as https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/benchmark/src/main.ts uses.
Also, you might be interested in https://github.com/karma-runner/karma/pull/3153. We’d like that functionality in so that we can test Karma rebuilds, and I think it might be relevant for you too since there’s a lot of tooling involved in Stryker.
Hi again 👋
I’ve got some good news. I’ve decided on another approach, implemented it and released it. It works 👍
However, it relies on a private api:
'@angular/cli/lib/cli'
. Before I close this issue, I would like to make a PR to make the cli public. It would allow programmatic execution of commands:@filipesilva would that be OK?
To use angular with mutation testing, you can use this guide: https://github.com/stryker-mutator/stryker-handbook/blob/master/stryker/configuration/angular.md
Basically it works like this:
ng test
command and keeps the server open.The implementation is based on the intellij karma plugin, which also executes
ng test
and keeps the server open. Nice find!Thanks for making this possible by merging #11181