feat(icon): provide standalone-friendly APIs for icon registry testing
- Dominant language
- TypeScript
- Stars
- 25k
- Forks
- 6.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 91
Description
### Feature Description
It would be nice to have a standalone `provideFakeIconRegistry` function to provide the `MatIconRegistry` with `FakeMatIconRegistry` as a replacement for using `MatIconTestingModule`.
This feature request is motivated by the want to enforce standalone APIs way of doing.
Just like the effort made in this commit : https://github.com/angular/components/commit/7840cd3a779b6e7388971e279bd60de2bcb1e89b
### Use Case
Replace :
```ts
TestBed.configureTestingModule({
imports: [MatIconTestingModule, /* ... */],
// ...
})
// OR
TestBed.configureTestingModule({
providers: [
//...
{
provide: MatIconRegistry,
useClass: FakeMatIconRegistry,
},
],
// ...
})
```
By :
```ts
TestBed.configureTestingModule({
providers: [provideFakeIconRegistry(), /* ... */],
// ...
})
```
Contributor guide
Research direction
Start by reading the existing MatIconTestingModule and FakeMatIconRegistry implementations, then compare the current TestBed provider usage with the requested standalone API. Done means callers can use provideFakeIconRegistry() in providers instead of MatIconTestingModule or the manual MatIconRegistry mapping, while retaining the fake registry behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100