DEV Community

Norlys Sánchez
Norlys Sánchez

Posted on • Edited on

Error Karma Test Upgrade angular 13

I made the migration of the angular from 11 to 12 and from 12-13.

The tests have stopped working, I used karma-coverage-istanbul-reporter, I have changed it has coverage.

// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

const ChromeHeadlessNoSandbox = {
base: 'ChromeHeadless',
flags: [ '--no-sandbox' ]
};

module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
//require('karma-coverage-istanbul-reporter'),
require('karma-teamcity-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
preprocessors: {
},
mime: {
'text/x-typescript': [
'ts',
'tsx'
]
},
client: {
jasmine: {
random: false,
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageReporter: {
dir: require('path').join(__dirname, 'coverage'),
reports: ['html', 'lcovonly', 'teamcity'],
fixWebpackSourcePaths: true,
'report-config': {
html: {
subdir: 'html'
},
lcovonly: {
subdir: 'lcov',
file: 'lcov.info'
},
cobertura: {
subdir: 'cobertura',
file: 'coverage.xml'
}
}
},
reporters: ['progress', 'kjhtml'],
port: 8080,
colors: true,
logLevel: config.LOG_WARN,
autoWatch: true,
browsers: ['Chrome', 'ChromeHeadless', 'ChromeHeadlessNoSandbox'],
customLaunchers: {
ChromeHeadlessNoSandbox
},
singleRun: true,
browserNoActivityTimeout: 60000,
browserDisconnectTimeout: 60000,
browserDisconnectTolerance: 10

});
};

Execute ng test and show errors:

Chrome 98.0.4758.82 (Windows 10) ERROR
Disconnected , because no message in 60000 ms.
18 02 2022 12:38:38.295:WARN [Chrome Headless 98.0.4758.82 (Windows 10)]: Disconnected (1 times) , because no message in 60000 ms.
Chrome Headless 98.0.4758.82 (Windows 10) ERROR
Disconnected , because no message in 60000 ms.
18 02 2022 12:38:38.357:WARN [Chrome Headless 98.0.4758.82 (Windows 10)]: Disconnected (1 times) , because no message in 60000 ms.
Chrome Headless 98.0.4758.82 (Windows 10) ERROR
Disconnected , because no message in 60000 ms.
18 02 2022 12:38:40.465:WARN [Chrome 98.0.4758.82 (Windows 10)]: Disconnected (1 times) , because no message in 60000 ms.
Chrome 98.0.4758.82 (Windows 10) ERROR
Disconnected , because no message in 60000 ms.
18 02 2022 12:39:39.088:WARN [Chrome Headless 98.0.4758.82 (Windows 10)]: Disconnected (2 times) , because no message in 60000 ms.
Chrome Headless 98.0.4758.82 (Windows 10) ERROR
Disconnected , because no message in 60000 ms.
18 02 2022 12:39:39.262:WARN [Chrome Headless 98.0.4758.82 (Windows 10)]: Disconnected (2 times) , because no message in 60000 ms.
Chrome Headless 98.0.4758.82 (Windows 10) ERROR
Disconnected , because no message in 60000 ms.
18 02 2022 12:39:42.252:WARN [Chrome 98.0.4758.82 (Windows 10)]: Disconnected (2 times) , because no message in 60000 ms.
Chrome 98.0.4758.82 (Windows 10) ERROR
Disconnected , because no message in 60000 ms.
18 02 2022 12:40:39.998:WARN [Chrome Headless 98.0.4758.82 (Windows 10)]: Disconnected (3 times) , because no message in 60000 ms.
Chrome Headless 98.0.4758.82 (Windows 10) ERROR
Disconnected , because no message in 60000 ms.
18 02 2022 12:40:40.216:WARN [Chrome Headless 98.0.4758.82 (Windows 10)]: Disconnected (3 times) , because no message in 60000 ms.
Chrome Headless 98.0.4758.82 (Windows 10) ERROR
Disconnected , because no message in 60000 ms.

Any suggestion. Thanks

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay