From f6ab9025d0f23db84b92d08e173022e267a866cb Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 29 Jan 2026 21:54:03 -0300 Subject: [PATCH] test: use esm in jest Signed-off-by: Carlos Alexandro Becker --- jest.config.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/jest.config.ts b/jest.config.ts index 0054977..86b554f 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -1,11 +1,24 @@ -module.exports = { +import type {Config} from 'jest'; + +const config: Config = { clearMocks: true, moduleFileExtensions: ['js', 'ts'], setupFiles: ['dotenv/config', '/src/test_setup.ts'], testMatch: ['**/*.test.ts'], testTimeout: 30000, transform: { - '^.+\\.ts$': 'ts-jest' + '^.+\\.ts$': [ + 'ts-jest', + { + useESM: true + } + ] + }, + extensionsToTreatAsEsm: ['.ts'], + moduleNameMapper: { + '^(\\.{1,2}/.*)\\.js$': '$1' }, verbose: true }; + +export default config;