karma-test-explorer icon indicating copy to clipboard operation
karma-test-explorer copied to clipboard

Karma Test explorer discovered 0 tests

Open ohjenssen opened this issue 10 months ago • 2 comments

Hello,

I've been using this extension for a little while. Its been working fine but all of a sudden it doesnt discover the tests any more. Tried uninstalling, disabling/enabling, restarting and updating the computer, still no tests discovered.

ohjenssen avatar Feb 26 '25 09:02 ohjenssen

I have a similar experience. Been using this extension a while as well, and it suddenly started failing to show the tests ~1-2 weeks ago . Looking at the output i get the following error:

[ERROR] [KarmaTestExplorer]: Failed to load tests - Karma server quit unexpectedly: Process exited with non-zero status code 1

mathias-solheim-4ss avatar Feb 27 '25 11:02 mathias-solheim-4ss

Same error here.

CampbellReid avatar Mar 13 '25 07:03 CampbellReid

After upgrade to angular 20:

[2025-06-04 06:20:43.663] [INFO] [DefaultTestManager]: Discovering tests
[2025-06-04 06:20:44.124] [WARN] [KarmaTestRunProcessor]: Test run encountered an error (Exit code: 1) - Error during refresh file list. TypeError: Cannot read properties of undefined (reading 'adapters')
[2025-06-04 06:20:44.125] [ERROR] [KarmaTestRunProcessor]: Could not capture Karma events - Test execution failed: Test run encountered an error
[2025-06-04 06:20:44.126] [ERROR] [DefaultTestManager]: Test discovery failed: Test run encountered an error
[2025-06-04 06:20:44.126] [ERROR] [KarmaTestExplorer]: Failed to load tests - Test discovery failed: Test run encountered an error
[2025-06-04 06:20:44.130] [INFO] [KarmaTestExplorer]: Finished loading tests in 10.29 secs (Failed)

JMS-1 avatar Jun 04 '25 06:06 JMS-1

In my case I think it is the migration to angular 20. The extension references @angular-devkit/build-angular and "somehow" "somewhere" inside the karma server (didn't analyse it through) references something called angular-polyfills which no longer exists.

JMS-1 avatar Jun 10 '25 16:06 JMS-1

Any updates on this? +1

alexandrosraikos avatar Jun 24 '25 09:06 alexandrosraikos

Both Karma and this project are deprecated. See more details in the deprecation notice.

lucono avatar Jul 07 '25 22:07 lucono

For anyone still experiencing this bug, the bug is in @angular/build see https://github.com/angular/angular-cli/issues/31039

And the following patch would fix it for @angular/[email protected]:

diff --git a/node_modules/@angular/build/src/builders/karma/application_builder.js b/node_modules/@angular/build/src/builders/karma/application_builder.js
index d51c47e..b9309a4 100644
--- a/node_modules/@angular/build/src/builders/karma/application_builder.js
+++ b/node_modules/@angular/build/src/builders/karma/application_builder.js
@@ -170,6 +170,7 @@ class AngularPolyfillsPlugin {
                         included: true,
                         watched: false,
                     });
+                    return { adapters:[] };
                 }, AngularPolyfillsPlugin),
             ],
         };

air2 avatar Aug 26 '25 14:08 air2