-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(material/icon): New NoopIconModule for silencing unit test errors #18151
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
Conversation
fbc814b
to
9a7f647
Compare
e93927e
to
800041a
Compare
0e96402
to
a0be7b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, aside from a couple of nits.
return this; | ||
} | ||
|
||
ngOnDestroy() { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we drop this one or is it required by the PublicApi
implementation? Technically the lifecycle hooks aren't part of the public API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tl;dr: It's required.
This one is unfortunate: it's required because PublicApi
. And then it turn the linter will complains if you have a lifecycle method without implementing the related interface, so it does add cruft. But, from a pure OO standpoint (i.e. Liskov substitution principle) it's more correct to support all the public methods that the original class exposes.
a0be7b2
to
5db673e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
5db673e
to
29398dd
Compare
Introducing the NoopIconModule to help silence Karma tests throwing warnings about custom icons not found. This added a lot of noise to tests output and it's now gone when `NoopMatIconModule` is installed in tests. The actual error this silences is `Error retrieving icon :xyz! Unable to find icon with the name ":xyz"`
29398dd
to
304e126
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@osuritz interested in adding docs in a follow-up PR? |
Renamed from |
…8151) Adds `MatIconTestingMdoule` to eliminate warnings of the form `Error retrieving icon :xyz! Unable to find icon with the name ":xyz"`. This warning added noise to tests output. When `MaticonTestingModule` is installed in tests, the fake implementation of the icon registry will always return fake SVG icons.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Introducing the NoopIconModule to help silence Karma tests throwing warnings about custom icons not found. This added a lot of noise to tests output and it's now gone when
NoopMatIconModule
is installed in tests. The actual error this silences isError retrieving icon :xyz! Unable to find icon with the name ":xyz"