Update Jest configuration for integration tests and improve command line options

This commit is contained in:
CSantosM 2026-01-26 14:10:53 +01:00
parent 659cdcaf73
commit 21e939e09c
3 changed files with 27 additions and 11 deletions

View File

@ -1,8 +1,9 @@
{ {
"jest.jestCommandLine": "node --experimental-vm-modules ../../node_modules/.bin/jest", "jest.jestCommandLine": "node --experimental-vm-modules ../../node_modules/.bin/jest --config jest.integration.config.mjs",
"jest.rootPath": "backend", "jest.rootPath": "backend",
"jest.nodeEnv": { "jest.nodeEnv": {
"NODE_OPTIONS": "--experimental-vm-modules" "NODE_OPTIONS": "--experimental-vm-modules"
}, },
"jest.runMode": "on-demand" "jest.runMode": "on-demand"
} }

View File

@ -15,16 +15,19 @@ const jestConfig = {
'^(\\.{1,2}/.*)\\.js$': '$1' // Allow importing js files and resolving to ts files '^(\\.{1,2}/.*)\\.js$': '$1' // Allow importing js files and resolving to ts files
}, },
transform: { transform: {
'^.+\\.tsx?$': ['ts-jest', { '^.+\\.tsx?$': [
tsconfig: { 'ts-jest',
module: 'esnext', {
moduleResolution: 'node16', tsconfig: {
esModuleInterop: true, module: 'esnext',
allowSyntheticDefaultImports: true, moduleResolution: 'node16',
isolatedModules: true esModuleInterop: true,
}, allowSyntheticDefaultImports: true,
useESM: true isolatedModules: true
}] },
useESM: true
}
]
} }
}; };

View File

@ -0,0 +1,12 @@
import baseConfig from './jest.config.mjs';
const integrationConfig = {
...baseConfig,
runInBand: true,
forceExit: true,
detectOpenHandles: true,
testMatch: ['**/tests/integration/**/*.(spec|test).ts'],
};
export default integrationConfig;