<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Arup Karan</title>
    <description>The latest articles on DEV Community by Arup Karan (@arupkaran).</description>
    <link>https://dev.to/arupkaran</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1129836%2Fccd6395f-78b0-4ed6-8d37-d7665fcc7a48.jpg</url>
      <title>DEV Community: Arup Karan</title>
      <link>https://dev.to/arupkaran</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arupkaran"/>
    <language>en</language>
    <item>
      <title>How to fix-Chrome Headless 115.0.5790.110 (Windows 10) ERROR Disconnected, because no message in 10000 ms of karma unit testing?</title>
      <dc:creator>Arup Karan</dc:creator>
      <pubDate>Mon, 31 Jul 2023 08:12:04 +0000</pubDate>
      <link>https://dev.to/arupkaran/jasminekarma-chrome-headless-11505790110-windows-10-error-disconnected-because-no-message-in-10000-ms-46ha</link>
      <guid>https://dev.to/arupkaran/jasminekarma-chrome-headless-11505790110-windows-10-error-disconnected-because-no-message-in-10000-ms-46ha</guid>
      <description>&lt;p&gt;We have a project with Angular15 and used Jasmine and Karma for uniting. &lt;br&gt;
While we executing the test case we are getting the error as per the image below. Some time its run properly but maximum time showing the error. We have not found any solution for this problem.&lt;/p&gt;

&lt;p&gt;Has anyone else come across this and possibly found a solution?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YWKtdT5Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f1jx5519cntcpd8wfti5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YWKtdT5Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f1jx5519cntcpd8wfti5.png" alt="Image description" width="800" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our karma.conf.js :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = function (config) {
  config.set({
    basePath: '',
    frameworks: ['parallel', 'jasmine', '@angular-devkit/build-angular'],
    plugins: [
      require('karma-parallel'),
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-coverage'),
      require('@angular-devkit/build-angular/plugins/karma'),
      require('karma-spec-reporter'),
    ],
    parallelOptions: {
      executors: 4, // Defaults to cpu-count - 1
      shardStrategy: 'round-robin'
    },
    client: {
      clearContext: false, // leave Jasmine Spec Runner output visible in browser
      jasmine: {
        random: false
      },
      captureConsole: false
    },
    jasmineHtmlReporter: {
      suppressAll: true // removes the duplicated traces
    },
    coverageReporter: {
      dir: require('path').join(__dirname, './coverage'),
      subdir: '.',
      reporters: [
        { type: 'html' },
        { type: 'text-summary' },
        { type : 'lcovonly'}
      ]
    },
    
    reporters: ["spec"],
    specReporter: {
      maxLogLines: 5,             // limit number of lines logged per test
      suppressSummary: false,      // do not print summary
      suppressErrorSummary: false, // do not print error summary
      suppressFailed: false,      // do not print information about failed tests
      suppressPassed: false,      // do not print information about passed tests
      suppressSkipped: true,      // do not print information about skipped tests
      showBrowser: false,         // print the browser for each spec
      showSpecTiming: true,      // print the time elapsed for each spec
      failFast: false             // test would finish with error when a first fail occurs
    },
    port: 9876,
    colors: true,
    logLevel: config.LOG_DISABLE,
    autoWatch: true,
    browsers: ['ChromeHeadless'],
    browserDisconnectTimeout: 10000,
    browserDisconnectTolerance: 3,
    singleRun: true,
    restartOnFileChange: true,
    browserNoActivityTimeout: 1000000
  });
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our test.ts :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'zone.js';
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
  BrowserDynamicTestingModule,
  platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
  BrowserDynamicTestingModule,
  platformBrowserDynamicTesting(),
  { teardown: { destroyAfterEach: false }},
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;jasmine/karma packages in package.json:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "@types/jasmine": "^4.3.2",
    "jasmine-core": "~3.10.1",
    "karma": "~6.3.9",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.1.0",
    "karma-jasmine": "~4.0.1",
    "karma-parallel": "^0.3.1",
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>jasmine</category>
      <category>karma</category>
      <category>angular</category>
    </item>
  </channel>
</rss>
