Karma测试在Webstorm调试器中失败

时间:2018-08-29 18:44:18

标签: angularjs typescript karma-webpack

我最近更新了AngularJS1.5应用程序以使用打字稿。现在,使用grunt test运行测试时,我的测试运行良好,而通过Webstorm运行测试时,它们也运行良好。但是,当我尝试调试任何测试时,都会收到Error: $injector:nomod错误。这是我正在使用的Karma配置

{
    webpack,

    // base path, that will be used to resolve files and exclude
    basePath: cwd,

    captureTimeout: 1200000,

    // testing framework to use (jasmine/mocha/qunit/...)
    frameworks: ['jasmine'],

    // list of files / patterns to load in the browser
    files: sourceFiles,

    exclude: [],

    // web server port
    port: 3000,

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

    // coverage reporting breaks Web Storm debugging
    reporters: ['progress', 'junit', 'html' /*, 'coverage-istanbul'*/],

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

    // Start these browsers, currently available:
    // - Chrome
    // - ChromeCanary
    // - Firefox
    // - Opera
    // - Safari (only Mac)
    // - PhantomJS
    // - IE (only Windows)
    browsers: ['Chrome'],

    // Continuous Integration mode
    // if true, it capture browsers, run tests and exit
    singleRun: false,

    preprocessors: {
        [ scriptsEntry ]: [ 'webpack', 'sourcemap' ]
    },

    junitReporter: {
        outputFile: '_dist/test-reports/unit-test-results/unit_tests.xml',
        suite: ''
    },
    sourcemap: true,
    mime: {
        'text/x-typescript': ['ts','tsx']
    },

    htmlReporter: {
        outputFile: '_dist/test-reports/unit-test-results/unit_tests.html'
    }

0 个答案:

没有答案