【问题标题】:Grunt : JASMINE is not supported anymoreGrunt:不再支持 JASMINE
【发布时间】:2013-08-18 03:54:49
【问题描述】:

我用 yeoman 创建了一个 Angular 应用程序,当我执行 grunt 命令时出现以下错误

Running "karma:unit" (karma) task
WARN [config]: JASMINE is not supported anymore.
        Please use `frameworks = ["jasmine"];` instead.
WARN [config]: JASMINE_ADAPTER is not supported anymore.
        Please use `frameworks = ["jasmine"];` instead.
WARN [config]: LOG_INFO is not supported anymore.
  Please use `karma.LOG_INFO` instead.
ERROR [config]: Config file must export a function!
  module.exports = function(config) {
    config.set({
      // your config
    });
  };

我该如何解决这个错误?

【问题讨论】:

    标签: gruntjs yeoman karma-runner


    【解决方案1】:

    只是这两个预定义的术语(JASMINE 和 JASMINE_ADAPTER) 那不应该再使用了。你所要做的就是打开 配置文件 ./config/karma.conf.js 并注释掉这些术语并添加 框架 = [“茉莉花”];.

    通过Yasuhiro Yoshida

    【讨论】:

    • 可以分享一下链接吗?
    • 您也可以在 google 中复制并越过该行 yasuhiroyoshida.github.io/2013/05/20/…
    • Fatal error: Port 9000 is already in use by another process. 但这个端口是 grunt 服务器!
    • 我试过了。 stackoverflow
    • 我得到ERROR [config]: Config file must export a function! module.exports = function(config) { config.set({ // your config }); }; 知道如何解决?
    【解决方案2】:

    除了@sheplu 的回答,karma.conf.js 中还需要做一些额外的改动,可以在https://gist.github.com/sivakumar-kailasam/6421378 看到

    这个要点解决了你的'配置文件必须是导出函数!'

    官方文档也有这些变化http://karma-runner.github.io/0.10/config/configuration-file.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-03
      • 2018-05-17
      • 2012-06-11
      • 2016-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多