test: fix

This commit is contained in:
Johannes Millan 2025-12-05 17:10:37 +01:00
parent a376268817
commit 8e50702009
3 changed files with 9 additions and 3 deletions

View file

@ -209,7 +209,7 @@
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"polyfills": ["zone.js", "zone.js/testing", "src/polyfills.ts"],
"tsConfig": "src/tsconfig.spec.json",
"preserveSymlinks": true,
"karmaConfig": "src/karma.conf.js",

View file

@ -150,6 +150,11 @@ describe('ProjectService', () => {
store.overrideSelector(selectNoteFeatureState, initialNoteState);
});
afterEach(() => {
// Reset selector mocks to prevent interference with other test files
store.resetSelectors();
});
it('should be created', () => {
expect(service).toBeTruthy();
});

View file

@ -1,7 +1,8 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js';
import 'zone.js/testing';
// NOTE: Do NOT import 'zone.js' or 'zone.js/testing' here explicitly.
// Angular's karma builder handles Zone.js setup automatically.
// Adding explicit imports causes conflicts with Jasmine's clock mocking.
import { getTestBed, TestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,