使用Jasmine.js警告:未定义引导

时间:2014-06-27 17:36:15

标签: javascript requirejs gruntjs jasmine phantomjs

我正在使用带有RequireJS和Grunt的Jasmine 1.3。我有一个笨拙的任务,这样做:

jasmine: {
        app: {
            options: {
                outfile: "<%= config.testPath() %>/jasmine_runner/_SpecRunner.html",
                specs: ["<%= config.testPath() %>/specs/*Spec.js"],
                template: require('grunt-template-jasmine-requirejs'),
                templateOptions:{
                    requireConfigFile: ['<%= config.appPath() %>/js/config.js','<%= config.testPath() %>/specs/testConfig.js']
                }
            }
        }
    }

从命令行执行grunt jasmine,它会出现此错误:

Running "jasmine:app" (jasmine) task
Warning: boot is not defined Use --force to continue.

Aborted due to warnings.

PhantomJS设置为在后台运行它。我已经对引导错误意味着什么但没有找到任何内容进行了广泛的搜索。

1 个答案:

答案 0 :(得分:0)

尝试更新grunt-contrib-jasmine的版本。

0.5.1升级到0.7.0为我解决了这个问题。

这是我的package.json供参考:

{
  "name": "...",
  "version": "0.1.0",
  "description": "...",
  "devDependencies": {
    "grunt": "^0.4.5",
    "matchdep": "^0.3.0",
    "grunt-contrib-concat": "^0.4.0",
    "grunt-contrib-uglify": "^0.5.0",
    "grunt-contrib-watch": "^0.6.1",
    "grunt-contrib-compass": "^0.9.0",
    "grunt-contrib-requirejs": "~0.4.4",
    "grunt-contrib-jasmine": "~0.7.0",
    "grunt-template-jasmine-requirejs": "~0.2.0"
  },
  ...
}