javascript - 检测 Jasmine 测试何时完成

标签 javascript jasmine

我正在运行 jasmine像这样测试;

   jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
   jasmine.getEnv().execute();

我想使用 JavaScript 检测测试何时完成。我该怎么办?

最佳答案

作为@Xv。建议,添加一个记者将工作。你可以做一些简单的事情:

jasmine.getEnv().addReporter({
    jasmineDone: function () {
        // the specs have finished!
    }
});

参见 http://jasmine.github.io/2.2/custom_reporter.html .

关于javascript - 检测 Jasmine 测试何时完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5980544/

相关文章:

angularjs - 如何在 jasmine 规范中使用 $promise.then 模拟 AngularJS $resource

javascript - 无法在 npm Ubuntu 中安装 jasmine-core

websocket - 使用 Jasmine 监视和调用 native WebSocket 构造函数

javascript - 仅在 Firefox 中通过 swfobject.jsaudio 嵌入 flash youtube 视频,适用于 ie6-ie7

javascript - 选择子元素 jQuery

javascript - 计时器上的 Jquery div 运动然后重复

angular - 我怎样才能有条件地允许导航到用户

asp.net - 在更新面板外部注入(inject) JavaScript

javascript - 如何从 Angular 链接获取值(value)

testing - 使用 jasmine.createSpyObj 实用程序构建 SpyObj 时声明 getter 属性?