ng test不执行任何测试用例

时间:2019-08-14 19:35:17

标签: angular testing

我正在使用angular2,并希望实现茉莉花因果测试。当我运行ng test时,它运行无错误,但不执行任何测试用例(说0执行0错误)。对"C:/Users/T01192B/Applications/capital-markets-frm-insight-profile/src/test.ts" does not match any file.的test.ts文件发出警告,它没有从路径中拾取test.ts。

尝试更改karma.config.js文件没有任何作用。

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
    },
    files: [{
      pattern: './src/test.ts',
      watched: false
    }],
    preprocessors: {
      './src/test.ts': ['@angular/cli']
    },
    mime: {
      'text/x-typescript': ['ts', 'tsx']
    },
    coverageIstanbulReporter: {
      reports: ['html', 'lcovonly'],
      fixWebpackSourcePaths: true
    },
    angularCli: {
      environment: 'dev'
    },
    reporters: config.angularCli && config.angularCli.codeCoverage ?
      ['progress', 'coverage-istanbul'] :
      ['progress', 'kjhtml'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Chrome'],
    singleRun: false
  });
};

0 个答案:

没有答案