Last active
August 19, 2022 13:07
-
-
Save carboleda/0358b87333aee4c81ed3b021f20a66cf to your computer and use it in GitHub Desktop.
Improving the Jest tests performance in CI environments when using Typescript - Medium Story
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent { docker { image 'node:18.7-alpine' } } | |
stages { | |
stage('test') { | |
steps { | |
sh 'npm run test:ci' | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isolatedModules = process.env.ISOLATED_MODULES === 'true'; | |
module.exports = { | |
// [...] | |
globals: { | |
'ts-jest': { | |
isolatedModules | |
} | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"test": "jest", | |
"test:ci": "ISOLATED_MODULES=true node --expose-gc ./node_modules/.bin/jest --runInBand" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment