我找不到任何关于如何在 grunt-contrib-nodeunit 模块中设置记者的信息,现在我的 Gruntfile.js 中有这个任务。
nodeunit: {
all: ['nodeunit/**/*.test.js'],
}
如何告诉 grunt 使用带有自定义输出路径的内置 JUnit 报告?
我找不到任何关于如何在 grunt-contrib-nodeunit 模块中设置记者的信息,现在我的 Gruntfile.js 中有这个任务。
nodeunit: {
all: ['nodeunit/**/*.test.js'],
}
如何告诉 grunt 使用带有自定义输出路径的内置 JUnit 报告?
查看您根本无法查看的代码。但是,您可以使用grunt-shell
do 这样做:
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'
}
}
},