angular / angular/angular-cli

Exclude TestBed.configureTestingModule in unit test code for Standalone Component

Aperta
#29,399 0 commenti 0 reazioni 1 assegnatario Rivendicata da @clydin Vedi su GitHub
area: @schematics/angular
Lingua principale
TypeScript
Stelle
27k
Fork
11.8k
Merge medio
14h 23m
PR unite (30g)
162

Descrizione

### 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_

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.