I have a suite of Jest tests that work ok running jest
locally - but when it runs just jest
in Jenkins it freezes on one of the tests and just hangs. The whole test suite normally takes about 15 seconds locally.
It does work on Jenkins when I run jest --runInBand
so that the tests are running sequentially.
What's the best way to debug this and/or what might be happening?
We just converted to typescript and ts-jest recently so I think that may be the culprit but still would like to understand the issue.
// jest.config.js
/* @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
roots: ["./src"],
preset: "ts-jest",
testEnvironment: "node",
transform: {
"^.+\\.(ts|tsx)?$": "ts-jest",
},
testMatch: ["**/?(*.)+(spec|test).+(ts|tsx|js)"],
}