简体   繁体   English

如何在不使用HTML记者的情况下检查茉莉花测试结果

[英]How to check result of jasmine test without using html reporter

Suppose i have a browser test that does: 假设我有一个浏览器测试,它可以:

describe('Test', function() {
    it('should fail', function() {
        expect(true).toBe(false);
    });
    it ('should pass', function() {
        expect(true).toBe(true);
    });
});

Usually what i do is call the jasmine test reporter but i need to check the result of a test without relying on html. 通常我要做的就是打电话给茉莉花测试报告者,但是我需要不依赖html来检查测试结果。 How do i do this? 我该怎么做呢?

You could add your own custom reporter , collect the data into a report structure that fits you and in jasmineDone you can use the data. 您可以添加自己的自定义报告程序 ,将数据收集到适合您的报告结构中,并且在jasmineDone可以使用数据。 For more tips on how data gets sent to reporters check out the JsApiReporter provided by jasmine. 有关如何将数据发送给记者的更多提示,请查看jasmine提供的JsApiReporter

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM