IntelliJ Ultimate - Unexpected Karma server behavior
Hello,
I recently started using Karma tests through IntelliJ Ultimate. However, I notice two weird behaviors:
- When debugging tests, breakpoints are only hit on the first run after the server launch. I have to shutdown/restart the server, because only the first test run would stop on breakpoints.
- Regardless of the run type (run, debug, coverage), it seems more clients are connecting to the Karma server, resulting in subsequent test runs to run the same tests multiple times, which clutters the output.
This is the configuration:

Here are the logs from Karma:
- Generating browser application bundles (phase: setup)...
TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and "false" respectively by the Angular CLI. To control ECMA version and features use the Browserslist configuration. For more information, see https://angular.io/guide/build#configuring-browser-compatibility
NOTE: You can set the "target" to "ES2022" in the project's tsconfig to remove this warning.
intellij: 'coverage' reporter was removed for faster run
10 09 2024 09:42:38.366:WARN [karma-server]: `autowatch` and `singleRun` are both `false`. In order to execute tests use `karma run`.
(node:23044) Warning: Accessing non-existent property 'VERSION' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
10 09 2024 09:42:38.370:INFO [preprocessor.coverage]: coverage not included in reporters [ 'intellij_c831a91b03572bad3b3db88354641e3b' ]
√ Browser application bundle generation complete.
10 09 2024 09:43:09.608:INFO [karma-server]: Karma v6.4.3 server started at http://localhost:9876/
10 09 2024 09:43:09.611:INFO [launcher]: Launching browsers ChromeHeadless with concurrency unlimited
10 09 2024 09:43:09.616:INFO [launcher]: Starting browser ChromeHeadless
10 09 2024 09:43:10.356:INFO [Chrome Headless 128.0.0.0 (Windows 10)]: Connected on socket _2IVasDS_iyIwpqNAAAB with id 94067594
10 09 2024 09:43:40.790:INFO [Chrome Headless 128.0.0.0 (Windows 10)]: Connected on socket MsQavJJp957KstuaAAAD with id 65238924
And as you can see, I indeed have two runs:

What am I doing wrong?
请先登录再写评论。
Could you please clarify if you changed the source code between your debugging attempts?
Regarding the second issue, unfortunately, we haven't faced it. Would it be possible to share a test project where we can reproduce it?