AngularCLI Karma测试未在圆圈CI上运行

时间:2017-09-04 20:24:08

标签: karma-runner circleci

我正在使用以下Angular脚本运行业力测试,但我收到错误karma start ./karma.conf.js ERROR [config]: Error in config file! Unexpected token =]

该文件在我的Windows本地计算机上正常运行,但是当我把它放在Bitbucket上并使用Circle CI(持续集成)运行时会出错

我注意到当我更改karma.conf.js并将其放在bitbucket上时,我收到以下警告 C:\ Users \ Manu \ Documents \ manu \ programs \ web \ angular \ dw-ng2-app> git add --all

warning: LF will be replaced by CRLF in karma.conf.js.
The file will have its original line endings in your working directory.

Karma文件

// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html

module.exports = function (config) {
  config.set({
    basePath: '',
    frameworks: ['jasmine', '@angular/cli'],
    plugins: [
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-jasmine-html-reporter'),
      require('karma-coverage-istanbul-reporter'),
      require('@angular/cli/plugins/karma')
    ],
    client:{
      clearContext: false // leave Jasmine Spec Runner output visible in browser
    },
    coverageIstanbulReporter: {
      reports: [ 'html', 'lcovonly' ],
      fixWebpackSourcePaths: true
    },
    angularCli: {
      environment: 'dev'
    },
    reporters: ['progress', 'kjhtml'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Chrome'],
    singleRun: false
  });
};

1 个答案:

答案 0 :(得分:1)

问题似乎出现在我为CircleCI创建的配置文件中。见npm install fails in circle ci (angular cli project)