jasmine - 使用 Jasmine 2、Protractor 和 Gulp 显示规范文本

标签 jasmine gulp protractor

我有一个运行 Protractor/Jasmine 的 Gulp 配置文件,如下所示:

.pipe($.protractor.protractor({ configFile: 'protractor.conf.js', args: args || ['--baseUrl', 'http://localhost:' + basePort] }))

但控制台中显示的报告只是点,而不是实际的规范测试。如何让 Jasmine 变得冗长?

这可以通过 Jasmine 1 中的 isVerbose 选项实现,但我找不到 Jasmine 2 的等效选项。

最佳答案

我们正在做的是设置这些 Jasmine 设置:

jasmineNodeOpts: {
    showColors: true,
    isVerbose: true,
    includeStackTrace: true,
    defaultTimeoutInterval: 100000,
    print: function() {}  
}

并使用 jasmine-spec-reporter package它提供了一个很好且详细的测试输出:

onPrepare: function () {  
    var SpecReporter = require('jasmine-spec-reporter');      
    // jasmine spec reporter
    jasmine.getEnv().addReporter(new SpecReporter({
        displayStacktrace: 'all',
        displayPendingSpec: true,
        displaySpecDuration: true
    }));
}

关于jasmine - 使用 Jasmine 2、Protractor 和 Gulp 显示规范文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36066035/

相关文章:

javascript - Jasmine 异步回调超时

javascript - Jasmine 2 : how to handle failing beforeAll

javascript - Jasmine 在 $scope.$on 上给出 TypeError

javascript - 如何在 Jasmine/React 中使用范围输入测试 `onChange` 事件

javascript - Rails + Jasmine-Ajax : what is the correct way to test code triggered by `ajax:success` (jquery-ujs)

reactjs - Mocha 不会识别 JSX

json - 无法读取 gulp-browserify 中未定义的属性 'emit'

gulp - BrowserSync 与自定义 URL

javascript - 单击某个输入触发焦点事件

javascript - 使用 Protractor 从 promise 中获取数据