angular / angular/angular-cli

Exclude TestBed.configureTestingModule in unit test code for Standalone Component

Ouverte
#29,399 0 commentaires 0 réactions 1 personne assignée Réclamée par @clydin Voir sur GitHub
area: @schematics/angular
Langage dominant
TypeScript
Étoiles
27k
Forks
11.8k
Merge moyen
14 h 23 min
PR mergées (30 j)
162

Description

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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.