如何设置 grunt-contrib-nodeunit 来输出 JUnit xml
How to setup grunt-contrib-nodeunit to output JUnit xml?
我找不到任何如何在grunt-contrib-nodeunit模块中设置报告器的信息,现在我的Gruntfile.js中有这个任务。
nodeunit: {
all: ['nodeunit/**/*.test.js'],
}
如何告诉咕噜咕噜使用带有自定义输出路径的内置 JUnit 报告?
查看代码,您根本无法做到。但是,您可以使用grunt-shell
执行此操作:
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-shell');
grunt.initConfig({
shell:{
nodeunit_with_junit:{
command: './node_modules/nodeunit/bin/nodeunit --reporter junit --output ./junit_ouput tests/*.test.js',
options:{
stdout: true,
stderr: true,
failOnError:false,
warnOnError: true
}
}
}
});
};
并用grunt shell:nodeunit_with_junit
运行它.
您可以在选项中设置报告器,如下所示:
nodeunit: {
client: ['test/unit/client/test*.js'],
server: ['test/unit/server/test*.js'],
options: {
reporter: 'junit',
reporterOptions: {
output: '_build'
}
}
},
相关文章:
- 在JavaScript中输出转义字符
- 如何在jQuery中将函数的输出分配给变量
- Javascript,输出结果后页面不断刷新
- Datetime格式为Friendly Time.Moment JS输出错误
- 如何将angularjs中的javascript字符串输出为循环数组
- HTML5FileReader输出到D3.js图表
- console.log以外的Javascript输出函数
- Eloquent JavaScript递归示例如何终止为返回1,但仍然输出指数值
- PHP中的数组输出
- 以不同的顺序输出数据
- 使用Rivets.js输出类
- 在Chrome扩展内部输出Google API调用
- 如何为d3.js图表输出组织/嵌套数据
- 将IndexedDB中的数据拉入数组,并通过ReactJS输出
- 如何在JUnit测试中测试wicket上的附加javascript ajaxBehavior
- 一个ajax循环有两个输出错误innerHTML
- 快速排序程序未正确输出
- 函数将输出nan而不是数字,为什么
- 在量角器中创建一个.txt错误输出文件是手动的,而不是控制台错误
- 如何设置 grunt-contrib-nodeunit 来输出 JUnit xml