Exclude TestBed.configureTestingModule in unit test code for Standalone Component

未關閉
#29,399 0 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

@clydin 已經在處理了。

開始於 2025年2月18日。

評估

這個 Issue 還沒有評估資料。

描述

area: @schematics/angular
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

主要語言
TypeScript
星號
27k
分支
11.8k
平均合併
16 小時 35 分鐘
30 天內合併 PR
176

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

angular/angular-cli 的其他 Issue

查看 angular/angular-cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。