feat(icon): provide standalone-friendly APIs for icon registry testing
- Ngôn ngữ chính
- TypeScript
- Star
- 25k
- Fork
- 6.8k
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 91
Mô tả
### 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(), /* ... */],
// ...
})
```
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách đọc các triển khai MatIconTestingModule và FakeMatIconRegistry hiện có, sau đó so sánh cách sử dụng provider hiện tại của TestBed với standalone API được yêu cầu. Hoàn tất có nghĩa là bên gọi có thể sử dụng provideFakeIconRegistry() trong providers thay cho MatIconTestingModule hoặc ánh xạ MatIconRegistry thủ công, đồng thời vẫn giữ nguyên hành vi của fake registry.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- angular, typescript
- Lĩnh vực
- testing
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100