6,603 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
36
views
npm test fails in Azure pipeline with Chrome Headless 107.0.5304.87 (Linux x86_64) ERROR
I have an Angular app with below specifications in my Azure pipeline
Angular: ^20.2.3
Node.js: v22.21.1
Karma: ~6.4.3
My tests run successfully in my local but fails in my pipeline with below error:
...
Advice
1
vote
1
replies
393
views
Angular: Vitest vs Jasmine/Karma
I am a bit confused with the Angular testing landscape. I have seen that Vitest will become the new default, replacing Karma. The question I then have is what about Jasmine. Does Vitest replace only ...
2
votes
1
answer
76
views
Angular Karma getting Module not found: Error: Can't resolve
I have a large Angular App that works fine. (v20 if it matters)
I recently added a new service to my App.Component, and now I'm getting the following error. ONLY in Karma, the service works as ...
0
votes
1
answer
92
views
jasmine.clock().autoTick() - autoTick is not a function [closed]
Here's the repo. There is a test where I want to use jasmine.clock().autoTick():
fit("show verification field", async () => {
jasmine.clock().install();
jasmine.clock()....
0
votes
0
answers
25
views
Firefox WebDriver Fails with "Cyclic object value" Error When Using jasmine-browser-runner with Ext.js 3.2.1
Firefox WebDriver Fails with "Cyclic object value" Error When Using jasmine-browser-runner with Ext.js 3.2.1
Problem Summary
jasmine-browser-runner works perfectly with Chrome but fails with ...
0
votes
0
answers
39
views
Karma + Jasmin mock query param
I am new to ts and to frontend. I want to write test that mocks query param in uri.
it('should read the query parameter', () => {
const stub = sinon.stub(window.location, 'search').get(() => '?...
1
vote
0
answers
94
views
Angular testing: async function did not complete within 5000ms in non async test
I have checked out several other questions related to my inquiry, including this one but my problem seems to be completely different.
in my angular project, every component is created with the Angular ...
1
vote
1
answer
126
views
Test coverage not detected with toSignal and debounceTime
I have a component in my Angular project (v18.2.13) that has a reactive form to change a price field & an observable with the product info. I want to make a signal to know if the price form field ...
-1
votes
1
answer
556
views
Angular 20 and fetching files in unit tests
I have an Angular 19 app which I just upgraded to version 20 and now all of my unit tests which fetch files to process are failing with 404 errors. I have changed noting at all in my unit tests or ...
2
votes
1
answer
273
views
Loading GoogleMaps API in Angular 20 Karma unit tests
Having updated an Angular v19 app to Angular v20, the Google Maps API is not being loaded in the Karma unit tests. All the unit tests on components which serve Google Maps fail with the following ...
0
votes
1
answer
45
views
unit test anchor link in Mat table cell
Trying to unit test, whether a cell is having hyperlink or not.
Not able to find the tag a via testHarness api.
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ...
1
vote
1
answer
81
views
Angular Test harness not setting ngModel variable in MatSelect
Using MatSelect and working on UTs.
Post selecting a option via test harness, not able to see ngModel variable binding working.
Here is the html snippet:
<mat-form-field class="dropdown-...
0
votes
1
answer
63
views
Angular unit testing relative RouterLinks
In my Angular app I need to be able to unit test that routerLink create the correct href attribute. Sometimes they are links relative to the current route, and sometimes they are absolute links from ...
2
votes
2
answers
406
views
Karma test runner keeps disconnecting when running locally
In my angular project, we are using the default test setup with Karma/Jasmine.
For my coworkers, it works fine, but only for me the tests are running incredibly slow, and also disconnect frequently, ...
1
vote
1
answer
397
views
Angular test case fails with NG0203: inject() must be called from an injection context
I'm testing an Angular 18 standalone component using TestBed and running into this error when the component is initialized during a unit test:
Error: NG0203: inject() must be called from an injection ...