Thursday, October 12, 2017

Unable to run angular4 test cases

I am getting an error (p.s. attached screenshot) when I run ng test in my angular4 app. I have not changed anything as such this just added some test specs in app.component.spec.ts

My karma.config.js file has following code

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', 'angular-cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-remap-istanbul'),
require('angular-cli/plugins/karma')
],
files: [
{ pattern: './src/test.ts', watched: false }
],
preprocessors: {
'./src/test.ts': ['angular-cli']
},
mime: {
'text/x-typescript': ['ts','tsx']
},
remapIstanbulReporter: {
reports: {
html: 'coverage',
lcovonly: './coverage/coverage.lcov'
}
},
angularCli: {
config: './angular-cli.json',
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'karma-remap-istanbul']
: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};

error:
error

Source: AngularJS



from Angular Questions https://angularquestions.com/2017/10/12/unable-to-run-angular4-test-cases/
via @lzomedia #developer #freelance #web #lzomedia.com

No comments:

Post a Comment