Created
September 16, 2022 20:45
-
-
Save ali-kamalizade/8d80bca17a7fde7abd2d1a237cef8732 to your computer and use it in GitHub Desktop.
A Jest configuration with globalSetup and globalTeardown
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
/** | |
* @type {import("ts-jest/dist/types").InitialOptionsTsJest} | |
*/ | |
module.exports = { | |
globalSetup: './jest-global-setup.ts', | |
globalTeardown: './jest-global-teardown.ts', | |
globals: { | |
'ts-jest': { | |
tsconfig: '<rootDir>/tsconfig.spec.json', | |
isolatedModules: true | |
} | |
}, | |
testEnvironment: 'node', | |
transform: { | |
'^.+\\.ts$': 'ts-jest' | |
}, | |
moduleFileExtensions: ['ts', 'js'], | |
setupFilesAfterEnv: ['./setup-jest.js'] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment