feat(icon): provide standalone-friendly APIs for icon registry testing
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.8k
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
### 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(), /* ... */],
// ...
})
```
Beitragsleitfaden
Rechercherichtung
Beginne damit, die bestehenden Implementierungen von MatIconTestingModule und FakeMatIconRegistry zu lesen, und vergleiche anschließend die aktuelle Verwendung von TestBed-Providern mit der angeforderten Standalone-API. Fertig ist die Umsetzung, wenn Aufrufer provideFakeIconRegistry() in providers anstelle von MatIconTestingModule oder der manuellen Zuordnung von MatIconRegistry verwenden können und dabei das Verhalten der Fake-Registry erhalten bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, typescript
- Bereich
- testing
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100