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

Support mutating angular HTML templates? #5156

Open
alexbird-hunterindustries opened this issue Jan 31, 2025 · 0 comments
Open

Support mutating angular HTML templates? #5156

alexbird-hunterindustries opened this issue Jan 31, 2025 · 0 comments
Labels
🚀 Feature request New feature request

Comments

@alexbird-hunterindustries

I'm working on an Angular 19 project, and one issue I'm facing is that we have no code coverage for our Angular HTML templates. The out-of-the-box, Angular-generated test renders the component, and our code coverage tool reports that component as fully covered. They TypeScript is fully covered, but if we deleted all the HTML the test would still pass.

I was thinking I could detect components with no coverage for the component HTML by doing mutation testing on the HTML. The first trivial step would be to remove all the HTML, run the tests, and make sure one fails. That would help us identify components that we missed entirely. Even better would be to properly generate mutants for the HTML so we could get more granular feedback about what parts of the HTML template are not covered.

I thought I might be able to write a stryker plugin to generate the HTML mutations, but in the docs for creating a plugin I did not see a "custom mutation" option.

I have not used stryker before, so I can't tell if this is a reasonable question to be asking. Is there any way -- either through writing a plugin, or forking and tweaking, or anything else -- that I could extend stryker to mutate my Angular HTML templates?

My alternative is to roll my own rudimentary mutation testing tool specific to Angular HTML templates. That is not a small task. So I would be open to doing some heavy lifting to fit it in to stryker instead of creating the whole thing myself.

I'd appreciate and suggestions you can give 🙏🏻.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 Feature request New feature request
Projects
None yet
Development

No branches or pull requests

1 participant