I am upgrading my angular from 4 to version 7. I had karma-parallel to run the tdd and it was working as expected with Angular 4. Now after upgrading to 7 the same tests are running twice before stop executing.
(我正在将我的angular从4升级到版本7。我已经运行了karma-parallel来运行tdd,并且可以按预期与Angular 4一起工作。现在升级到7后,相同的测试运行了两次,然后停止执行。)
My karma.conf.js is as below, (我的karma.conf.js如下所示,)
const path = require('path');
module.exports = function (config) {
config.set({
basePath: '',
frameworks: [ 'parallel', 'jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-parallel'),
require('karma-jasmine'),
require('karma-spec-reporter'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
parallelOptions: {
executors: 3, // For Jenkins enterprise, stick to 6 executors. For local laptop, change to 3-5
shardStrategy: 'round-robin'
},
client: {
jasmine: {
random: false
},
clearContext: false
},
coverageIstanbulReporter: {
reports: ['html', 'json', 'text-summary'],
dir: path.join(__dirname, 'coverage'),
fixWebpackSourcePaths: true
},
reporters: ['spec', 'kjhtml'],
specReporter: {
maxLogLines: 5,
suppressErrorSummary: true,
suppressFailed: false,
suppressPassed: false,
suppressSkipped: true,
showSpecTiming: true,
failFast: false
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['ChromeHeadlessNoSandbox'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: [
'--no-sandbox', // required to run without privileges in docker
'--user-data-dir=/tmp/chrome-test-profile',
'--disable-web-security',
'--no-proxy=http://0.0.0.0:9876/'
]
}
},
singleRun: true,
concurrency: Infinity,
captureTimeout: 180000,
browserDisconnectTimeout: 90000,
browserNoActivityTimeout: 180000
});
};
The command used to run the test cases is as below,
(用于运行测试用例的命令如下,)
node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng test --watch=false --code-coverage --source-map=false
Please advice.
(请指教。)
ask by Geo j translate from so