【问题标题】:Unit testing specific components in Angular在 Angular 中对特定组件进行单元测试
【发布时间】:2021-03-12 00:35:46
【问题描述】:

在我的 Angular 项目中,我在父 Angular 项目中有一个 Angular 项目 - 所以第二个 Angular 项目(子)就像一个模块应用程序。当我测试应用程序时,它总是需要父 app.component.spec.ts 在 Jasmine Karma 中进行测试。我已经尝试通过终端导航到特定文件夹并运行ng test,但仍然对父级app.component.spec.ts 进行测试?

知道如何测试特定组件吗?

【问题讨论】:

    标签: angular unit-testing


    【解决方案1】:

    it 更改为 fit 以仅测试此测试。

    it 更改为xit 以跳过此测试。

    describe 更改为 fdescribe 以测试此 describe 中的所有 its。

    describe 更改为xdescribe 以跳过此describe 中的所有its。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-13
      • 2019-01-02
      • 2017-01-09
      • 2021-10-07
      • 2019-11-02
      • 2016-04-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多