test: use esm in jest

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker 2026-01-29 21:54:03 -03:00
parent a4205e6fb8
commit f6ab9025d0
No known key found for this signature in database

View file

@ -1,11 +1,24 @@
module.exports = {
import type {Config} from 'jest';
const config: Config = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
setupFiles: ['dotenv/config', '<rootDir>/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;