angular / angular/angular-cli

Exclude TestBed.configureTestingModule in unit test code for Standalone Component

Đang mở
#29,399 0 bình luận 0 reaction 1 người được giao Được @clydin nhận Xem trên GitHub
area: @schematics/angular
Ngôn ngữ chính
TypeScript
Star
27k
Fork
11.8k
Merge trung bình
14 giờ 23 phút
Pull request đã merge (30 ngày)
162

Mô tả

### Command

generate

### Description

Hi,
I not sure if there is any current plan for this.
Currently, generating a new component with Angular CLI includes the below statement

```
await TestBed.configureTestingModule({
imports: [ProductListComponent]
})
.compileComponents();
```

### Describe the solution you'd like

Given that **TestBed.configureTestingModule** is no longer required, as component is standalone by default, the statement should be excluded from the generated unit test file (to avoid cluttering the code) when generating component with Angular CLI , unless standalone option is turned off explicitly

### Describe alternatives you've considered

_No response_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.