5

我已经配置了我的 qunit 任务,如下所示:

 // Unit Test Configuration
    qunit: {
        ac: {
            files: ['test/**/*.html']
        }
    }
    grunt.registerTask('ac', ['jshint:ac', 'qunit:ac']);

jsHint 运行良好。但是使用 qunit 我收到错误:

运行“qunit:ac”(qunit)任务警告:不能使用“in”运算符搜索“src”

4

1 回答 1

7

更改files: ['test/**/*.html']src: ['test/**/*.html']。该files属性适用于多个src/dest配对。请参阅http://gruntjs.com/configuring-tasks#files-object-format

例如:

qunit: {
  ac: {
    files: [{
      src: ['test/**/*.html']
    }, {
      src: ['test2/**/*.html']
    }]
  }
}

如果你只是想要一个更简单的配置test/**/*.html是:

qunit: {
  ac: ['test/**/*.html']
}
于 2013-05-14T23:21:41.730 回答