我得到了一个错误:
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
我得到了一个错误:
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我没有看到这样的信息.
所以我们仍然可以使用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");
});
});