chore: update jest config

This commit is contained in:
Simon Chan 2022-11-16 00:42:53 +08:00
parent a2c96e4c08
commit ccb9d32def
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
18 changed files with 103 additions and 58 deletions

View file

@ -1,13 +1,14 @@
/** @type {import('ts-jest').InitialOptionsTsJest} */
export default {
preset: "ts-jest/presets/default-esm",
globals: {
'ts-jest': {
tsconfig: 'tsconfig.test.json',
useESM: true,
},
extensionsToTreatAsEsm: [".ts"],
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{ tsconfig: "tsconfig.test.json", useESM: true },
],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
"^(\\.{1,2}/.*)\\.js$": "$1",
},
};