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

feat(core/frameworks): add ignore plugin for Angular IO functions #4789

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

kal-rein
Copy link

Since Angular 16 and 17 there is a new way to perform IO operations with data inside components and directives using signals with the input(), model() and output() functions. These functions are effectively a counterpart of the @Input() and @Output() decorators and thus accept a configuration object as part of their parameters.

Currently, StrykerJS doesn't place mutations inside decorators so the configuration object while performing IO with them are unaffected. But functions are mutated, so the configuration object inside them is as well leading into errors with the ivy compiler.

This PR aims to include a new ignore plugin inside the core package that can be used to avoid the mentioned problem when using the new signal functions. It can be used by including the angular ignorer inside the ignorers property in the configuration file, e.g.

{
  "ignorers": ["angular"]
}

Closes #4771

kal-rein and others added 6 commits March 17, 2024 21:39
Add a new ignore plugin that can be used to avoid errors when using the new Angular input, model and output functions. Without it, the options object inside the function can be mutated leading into errors with the ivy compiler.
The ignorer impacts how the instrumenter works on Angular components and directives, so it makes more sense for it to be inside the instrumenter package. It also makes testing easier.
@kal-rein
Copy link
Author

@nicojs should the init command include the angular ignorer into the config file if the project type is angular-cli? Right now it's not mandatory as @Input and @Output are not deprecated, so most people will continue to use that, but that might change at some point.

Also, this should be mentioned somewhere in the docs, but I'm not sure which page is more appropriate, the angular guide or the troubleshooting page. Maybe both with a different wording, so new projects are aware of when it is necessary and old projects have an easier time debugging the error.

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

Successfully merging this pull request may close these issues.

Error: No tests were executed when using aliased signal inputs in an Angular 17 application
1 participant