test: migrate from Karma and Jasmine to Vitest

Karma is deprecated and depends on braces, which has no patched release for GHSA-vfj7-8cjw-p6xm. Tests now run through the @angular/build unit-test builder with Vitest and jsdom. fakeAsync is replaced by Vitest fake timers, and zone.js is dropped because the zoneless app only loaded it for the Karma test polyfills.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
fraujulianandClaude Opus 5.5 committed 2026-10-06 20:44:40 +02:00
1 parent 81613d701a
commit ca1cf8aefe
7 files changed
+763 -1886

No files matched your search

+8 -6
View File
@@ -31,7 +31,9 @@ describe('AppComponent', (): void => {
});
it('should preselect English by default', (): void => {
const comp = component as unknown as { selectedLanguage(): string };
const comp = component as unknown as {
selectedLanguage(): string;
};
expect(comp.selectedLanguage()).toBe('en');
});
@@ -57,8 +59,8 @@ describe('AppComponent', (): void => {
fixture.detectChanges();
expect(comp.currentLanguageCode()).toBe('de');
expect(comp.isLanguageConfirmed()).toBeTrue();
expect(comp.isLanguageSelectorOpen()).toBeFalse();
expect(comp.isLanguageConfirmed()).toBe(true);
expect(comp.isLanguageSelectorOpen()).toBe(false);
expect(localStorage.getItem('portfolio-language')).toBe('de');
});
@@ -74,8 +76,8 @@ describe('AppComponent', (): void => {
};
expect(restoredComponent.currentLanguageCode()).toBe('de');
expect(restoredComponent.isLanguageConfirmed()).toBeTrue();
expect(restoredComponent.isLanguageSelectorOpen()).toBeFalse();
expect(restoredComponent.isLanguageConfirmed()).toBe(true);
expect(restoredComponent.isLanguageSelectorOpen()).toBe(false);
});
it('should reopen the selector after confirmation', (): void => {
@@ -89,6 +91,6 @@ describe('AppComponent', (): void => {
comp.reopenLanguageSelector();
fixture.detectChanges();
expect(comp.isLanguageSelectorOpen()).toBeTrue();
expect(comp.isLanguageSelectorOpen()).toBe(true);
});
});