【问题标题】:Using Jasmine.js Warning:boot is not defined使用 Jasmine.js 警告:未定义引导
【发布时间】:2014-06-27 17:36:14
【问题描述】:

我正在使用带有 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 设置为在后台运行它。我已经对启动错误的含义进行了广泛的搜索,但没有找到任何东西。

【问题讨论】:

标签: javascript requirejs gruntjs jasmine phantomjs


【解决方案1】:

尝试更新您的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"
  },
  ...
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-22
    • 1970-01-01
    • 2016-01-14
    • 2013-04-22
    • 2019-01-14
    相关资源
    最近更新 更多