From 8be08a457a3dc487ff925ebbd1e97e1f67d99c18 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 4 Oct 2025 09:58:59 +0200 Subject: [PATCH] WIP: Nach Chat-GPT Fragerunde... --- jest.config.ts | 12 ++++++++++++ setup-jest.ts | 4 +--- tsconfig.spec.json | 4 +++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/jest.config.ts b/jest.config.ts index e3c292a0..cb97bddf 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -1,5 +1,17 @@ import type { Config } from 'jest'; export default { + preset: 'jest-preset-angular', setupFilesAfterEnv: ['/setup-jest.ts'], + testEnvironment: 'jsdom', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'ts-jest', + { + tsconfig: '/tsconfig.spec.json', + stringifyContentPathRegex: '\\.html$', + }, + ], + }, + moduleFileExtensions: ['ts', 'html', 'js', 'json'], } satisfies Config; diff --git a/setup-jest.ts b/setup-jest.ts index 58c511e0..7197a78d 100644 --- a/setup-jest.ts +++ b/setup-jest.ts @@ -1,3 +1 @@ -import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone'; - -setupZoneTestEnv(); +import 'jest-preset-angular/jest-preset'; diff --git a/tsconfig.spec.json b/tsconfig.spec.json index a9dda093..9f8bf50a 100644 --- a/tsconfig.spec.json +++ b/tsconfig.spec.json @@ -4,7 +4,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/spec", - "module": "CommonJS", + "module": "commonjs", + "esModuleInterop": true, + "target": "es2018", "types": [ "jest" ] -- 2.39.5