我得到了一个错误:

ERROR: 'DEPRECATION: fit and fdescribe will cause your suite to report an 'incomplete' status in Jasmine 3.0'

我为Jasmine 3.0做了一个RTFM,但它没有提到任何关于弃用的内容:https://jasmine.github.io/api/3.0/global.html#fit

推荐答案

他们已经修复了我使用jasmine v3的警告.3.1我没有看到这样的信息.

enter image description here

所以我们仍然可以使用fit和fdescribe,请阅读下面的代码和注释.它经过测试,易于理解.

//If you want to run few describe only add f so using focus those describe blocks and it's it block get run

  fdescribe("focus description i get run with all my it blocks ", function() {
    it("1 it in fdescribe get executed", function() {
        console.log("1 it in fdescribe get executed unless no fit within describe");

    });
    it("2 it in fdescribe get executed", function() {
        console.log("2 it in fdescribe get executed unless no fit within describe");

    });
    //but if you and fit in fdescribe block only the fit blocks get executed
    fit("3  only fit blocks in  fdescribe get executed", function() {
        console.log("If there is  a fit   in fdescribe only fit blocks  get executed");

    });
  });

  describe("none description i get skipped with all my it blocks ", function() {
        it("1 it in none describe get skipped", function() {
            console.log("1 it in none describe get skipped");

        });
        it("2 it in none describe get skipped", function() {
            console.log("2 it in none describe get skipped");
        });
//What happen if we had fit in a none fdescribe block will it get run ?   yes  
       fit("3 fit in none describe get executed too eventhough it;s just describe ", function() {
            console.log("3 fit in none describe get executed too");
        }); 
      });

Angular相关问答推荐

Angular Signal只指一种类型,但这里用作值.ts(2693)''

添加@ nx/webpack插件 destruct 了Nativescript构建

如果过滤器在rxjs流中触发,则返回空数组

当元素在元素上使用迭代变量时,如何重构ngFor?

天使17中的倒计时器

使用 TAB 键时如何聚焦mat-select组件?

如何将 Firebase 云消息传递 (FCM) 与 Angular 15 结合使用?

如何处理后端删除元素后元素列表的刷新

Angular 升级后 RXJS SwitchMap 无法与解析器一起正常工作

Angular JWT Token 被添加到lazyUpdate 而不是 HttpHeaders 中的标头

等待两个订阅完成而不嵌套

带有嵌套表单数组的 Angular react式表单

模块AppModule导入的意外指令LoginComponent,请添加@NgModule 注释

Angular 2+ ngModule 中导入/导出的作用

具有多个订阅者的 Angular 2 Observable

如何在 Angular 应用程序中通过路由更改页面标题?

单元测试错误:无法从同步测试中调用 Promise.then

ng build 时超出调用重试次数异常

如何升级 Angular CLI 项目?

模拟子组件 - Angular 2