From a0a70ba847056a24d79cb96f32cd08fcb1a19852 Mon Sep 17 00:00:00 2001 From: Joel Carter Date: Wed, 17 Jul 2024 07:37:13 -0500 Subject: [PATCH] Update jest to work with new compile --- jest.config.cjs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/jest.config.cjs b/jest.config.cjs index e1f316f..03b8aae 100644 --- a/jest.config.cjs +++ b/jest.config.cjs @@ -1,23 +1,16 @@ const generateJestConfig = ({ esModules }) => { const esModulesList = Array.isArray(esModules) ? esModules.join('|') : esModules return { - coveragePathIgnorePatterns: ['/src/Server'], - coverageThreshold: { - global: { - branches: 50, - functions: 70, - lines: 70, - statements: 70, - }, - }, + coveragePathIgnorePatterns: ['/(.*)/dist'], + extensionsToTreatAsEsm: ['.ts'], moduleNameMapper: { '^(\\.{1,2}/.*)\\.js$': '$1', }, - preset: 'ts-jest/presets/default-esm', + preset: 'ts-jest', setupFiles: ['dotenv/config'], setupFilesAfterEnv: [], - testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$', - testTimeout: 15000, + testRegex: String.raw`(/__tests__/.*|(\.|/)(test|spec))\.tsx?$`, + testTimeout: 15_000, transform: { [`(${esModulesList}).+\\.js$`]: [ 'babel-jest',