将grunt配置为使用jenkins和qunit进行自动JS测试,我实际上是在阻止这个问题。
当我运行咕噜:运行"qunit_junit“任务
XML报告将被写入_build/test-reports没有找到"qunit“目标。警告:任务"qunit“失败。继续使用武力。
Aborted due to warnings.我的公文包:
'use strict';
module.exports = function(grunt) {
var gruntConfig = {};
grunt.initConfig({
sync: {
target: {}
}
});
grunt.registerTask('default', ['qunit_junit', 'qunit']);
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-qunit-istanbul');
gruntConfig.qunit = {
src: ['static/test/index.html'],
options: {
coverage: {
src: ['static/js/**/*.js'],
instrumentedFiles: 'temp/',
htmlReport: 'report/coverage',
coberturaReport: 'report/',
linesThresholdPct: 20
}
}
};
grunt.loadNpmTasks('grunt-qunit-junit');
gruntConfig.qunit_junit = {
options: {
dest: 'report/'
}
};
};我在console.log()中检查了node_modules,安装了grunt -contrib单元,任务就在其中,所以grunt找到了模块和任务,但似乎没有加载它。
发布于 2016-08-31 16:56:46
只是一目了然-你正在创建你的配置,但没有做任何事情。
更改这一行
grunt.initConfig({
sync: {
target: {}
}
});对此:
grunt.initConfig(gruntConfig);您还可能希望将其向下移到添加到gruntConfig中的所有其他内容下面。
https://stackoverflow.com/questions/39254833
复制相似问题