6

尝试创建伊斯坦布尔报告(angular2-cli 应用程序)时,出现以下错误

[Error: Could not find source map for:"/Users/dylan/IdeaProjects/IssueTracker2-UI/code/dist/vendor/es6-shim/es6-shim.js"]
[Error: Could not find source map for: "/Users/dylan/IdeaProjects/IssueTracker2-UI/code/dist/vendor/zone.js/dist/zone.js"]
Error: Could not find file: "/Users/dylan/IdeaProjects/IssueTracker2-UI/code/dist/vendor/systemjs/dist/system-polyfills.js.map"

这是我跑步的时候npm run posttest。这在下面我的 package.json 中有说明。

     "posttest": "node_modules/.bin/remap-istanbul -i coverage/coverage-final.json -o coverage -t html",
     "coverage": "http-server -c-1 -o -p 9875 ./coverage"

下面我将显示我的karma.conf.js文件

 // 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'],
plugins: [
  require('karma-jasmine'),
  require('karma-chrome-launcher'),
  require('karma-coverage')
],
customLaunchers: {
  // chrome setup for travis CI using chromium
  Chrome_travis_ci: {
    base: 'Chrome',
    flags: ['--no-sandbox']
  }
},
files: [
  { pattern: 'dist/vendor/es6-shim/es6-shim.js', included: true, watched: false },
  { pattern: 'dist/vendor/zone.js/dist/zone.js', included: true, watched: false },
  { pattern: 'dist/vendor/reflect-metadata/Reflect.js', included: true, watched: false },
  { pattern: 'dist/vendor/systemjs/dist/system-polyfills.js', included: true, watched: false },
  { pattern: 'dist/vendor/systemjs/dist/system.src.js', included: true, watched: false },
  { pattern: 'dist/vendor/zone.js/dist/async-test.js', included: true, watched: false },
  { pattern: 'dist/vendor/zone.js/dist/fake-async-test.js', included: true, watched: false },

  { pattern: 'config/karma-test-shim.js', included: true, watched: true },

  // Distribution folder.
  { pattern: 'dist/**/*', included: false, watched: false },

  { pattern: 'src/**/*.ts', included: false, watched: false },
  { pattern: 'dist/**/*.js.map', included: false, watched: false }
],
exclude: [
  // Vendor packages might include spec files. We don't want to use those.
  'dist/vendor/**/*.spec.js'
],
preprocessors: {'dist/**/!(*spec).js': ['coverage']},
reporters: ['progress','dots','coverage'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['Chrome'],
singleRun: true,

proxies : {
  '/src/': '/base/src/'
},

coverageReporter : {
  reporters:[
    {type:'json', subdir: '.', file: 'coverage-final.json'}
  ]
}
});
};

谢谢!

4

0 回答 0