Karma Test explorer discovered 0 tests
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.
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
Same error here.
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)
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.
Any updates on this? +1
Both Karma and this project are deprecated. See more details in the deprecation notice.
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),
],
};