diff --git a/CourageScores/ClientApp/jest.config.ts b/CourageScores/ClientApp/jest.config.ts index 1e3d4390b..9332f7cbb 100644 --- a/CourageScores/ClientApp/jest.config.ts +++ b/CourageScores/ClientApp/jest.config.ts @@ -4,6 +4,7 @@ import { createJsWithTsPreset } from 'ts-jest'; const presetConfig = createJsWithTsPreset({}); export default { + ...presetConfig, testEnvironment: 'jest-environment-jsdom', testMatch: ['**/*.test.ts', '**/*.test.tsx'], maxWorkers: '50%', @@ -22,5 +23,4 @@ export default { '!src/interfaces/models/**/*.ts', ], setupFiles: ['/setup.jest.js'], - ...presetConfig, } satisfies Config; diff --git a/CourageScores/ClientApp/package.json b/CourageScores/ClientApp/package.json index e8dc0a76c..24ececb32 100644 --- a/CourageScores/ClientApp/package.json +++ b/CourageScores/ClientApp/package.json @@ -51,8 +51,9 @@ "compile-ts": "tsc", "build": "tsc && vite build --emptyOutDir", "preview": "vite preview", - "test": "env TZ=Europe/London jest", - "compile-and-test": "tsc && env TZ=Europe/London jest" + "test": "env TZ=Europe/London node node_modules/jest/bin/jest.js", + "test-experimental": "env TZ=Europe/London node --no-warnings --experimental-vm-modules node_modules/jest/bin/jest.js", + "compile-and-test": "tsc && env TZ=Europe/London node node_modules/jest/bin/jest.js" }, "eslintConfig": { "extends": [ diff --git a/CourageScores/ClientApp/tsconfig.json b/CourageScores/ClientApp/tsconfig.json index b4ac4ceeb..43e6b4818 100644 --- a/CourageScores/ClientApp/tsconfig.json +++ b/CourageScores/ClientApp/tsconfig.json @@ -24,11 +24,11 @@ "module": "esnext", "resolveJsonModule": true, "allowImportingTsExtensions": true, + "moduleResolution": "bundler", "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", "rootDir": "./src/", - "ignoreDeprecations": "6.0", // to silence warning about moduleResolution=node10 }, "exclude": [ "node_modules", "dist"