diff --git a/lambdas/user-list-search-corpus-parser-hydration/jest.config.js b/lambdas/user-list-search-corpus-parser-hydration/jest.config.js deleted file mode 100644 index 261c6d146..000000000 --- a/lambdas/user-list-search-corpus-parser-hydration/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - displayName: 'corpus-parser-hyration-lambda', -}; diff --git a/lambdas/user-list-search-corpus-parser-hydration/jest.config.ts b/lambdas/user-list-search-corpus-parser-hydration/jest.config.ts new file mode 100644 index 000000000..7be2eaefb --- /dev/null +++ b/lambdas/user-list-search-corpus-parser-hydration/jest.config.ts @@ -0,0 +1,16 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + displayName: 'corpus-parser-hyration-lambda', + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/user-list-search-corpus-parser-hydration/jest.setup.js b/lambdas/user-list-search-corpus-parser-hydration/jest.setup.ts similarity index 100% rename from lambdas/user-list-search-corpus-parser-hydration/jest.setup.js rename to lambdas/user-list-search-corpus-parser-hydration/jest.setup.ts diff --git a/lambdas/user-list-search-corpus-parser-hydration/tsconfig.json b/lambdas/user-list-search-corpus-parser-hydration/tsconfig.json index 7b34686ba..28c15a0e1 100644 --- a/lambdas/user-list-search-corpus-parser-hydration/tsconfig.json +++ b/lambdas/user-list-search-corpus-parser-hydration/tsconfig.json @@ -4,6 +4,6 @@ "outDir": "dist", "rootDir": "src" }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"], "include": ["src/**/*.ts"] } diff --git a/packages/ts-logger/jest.config.ts b/packages/ts-logger/jest.config.ts index 0bc59635e..046ed7d15 100644 --- a/packages/ts-logger/jest.config.ts +++ b/packages/ts-logger/jest.config.ts @@ -5,6 +5,7 @@ const config: Config = { testEnvironment: 'node', testMatch: ['**/?(*.)+(jest|spec).[jt]s?(x)'], testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], moduleNameMapper: { "^(\\.{1,2}/.*)\\.js$": "$1" }, diff --git a/packages/ts-logger/jest.setup.ts b/packages/ts-logger/jest.setup.ts new file mode 100644 index 000000000..ea691468e --- /dev/null +++ b/packages/ts-logger/jest.setup.ts @@ -0,0 +1 @@ +process.env.NODE_ENV = undefined; \ No newline at end of file