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.nodeEnv": {
"NODE_OPTIONS": "--experimental-vm-modules"
},
"jest.runMode": "on-demand"
}

View File

@ -15,7 +15,9 @@ const jestConfig = {
'^(\\.{1,2}/.*)\\.js$': '$1' // Allow importing js files and resolving to ts files
},
transform: {
'^.+\\.tsx?$': ['ts-jest', {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: {
module: 'esnext',
moduleResolution: 'node16',
@ -24,7 +26,8 @@ const jestConfig = {
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;