javascript - Jasmine 中的跳跃测试

标签 javascript jasmine

我想知道 Jasmine 中是否存在类似 JUnit 中的 @ignore 的东西。 我想忽略一些测试,但不是全部。

我指的是这样的:

@Ignore
describe("Hello world", function() {
  it("says hello", function() {
    expect(helloWorld()).toEqual("Hello world!");
  });
});

谢谢

最佳答案

您可以在 describeit block 前加上 x 前缀,它们将被禁用。因此,实际上您正在调用 xdescribexit

xdescribe("Hello world", function() {
  it("says hello", function() {
    expect(helloWorld()).toEqual("Hello world!");
  });
});

关于javascript - Jasmine 中的跳跃测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41895032/

相关文章:

javascript - AngularJS 单元测试中找不到模块错误

javascript - 无法断言数组列表中存在关键字

javascript - html5 地理定位是否有 'GPS status changed' 事件?

javascript - Handsontable:更新列设置,但排除第一行

javascript - 删除最后一个字符时光标返回到 contenteditable Div 的开头

javascript - 一个 stub 如何与 sinon promise ?

angular - TestBed 模拟服务

javascript - Jasmine:然后在 AngularJS Promise 中调用

Javascript 禁用按钮

javascript - 以下 javascript 函数发生了什么