无效的配置文件!参考错误:未定义模块(Karma和Angular.JS)

时间:2014-03-28 17:16:26

标签: config karma-runner

Invalid Config File! Reference Error: module is not defined(Karma和AngularJS)

我试图使用Jetbrains Webstorm 8.0程序使用AngularJS设置Karma

我在Windows 7 64位上。

我安装了Karma,但我无法从Angular-Seed获得test.bat。

我的配置文件:

// Karma configuration
// Generated on Fri Mar 28 2014 12:03:57 GMT-0400 (Eastern Daylight Time)

module.exports = function(config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
      basePath: '../',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['mocha'],


    // list of files / patterns to load in the browser
      files: [
          'app/lib/angular/angular.js',
          'app/lib/angular/angular-*.js',
          'test/lib/angular/angular-mocks.js',
          'app/js/*.js',
          'test/unit/*.js',
          'scripts/test.bat'
      ] ,


    // list of files to exclude
    exclude: [

    ],


    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {

    },


    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],


    // web server port
    port: 9876,


    // enable / disable colors in the output (reporters and logs)
    colors: true,


    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_INFO,


    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,


    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['Chrome'],


    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: false
  });
};

    browsers = ['Chrome'];

当我运行karma.conf.js时,我得到了

Uncaught SyntaxError: Unexpected token ILLEGAL
at (localhost)9876/base/scripts/test.bat?09dc64f0c86737cc5be1cfc2402dd7a0f33a22a4:1

当我在脚本中运行test.bat时,我得到标题中提到的引用错误。

任何帮助?

0 个答案:

没有答案