-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tests): fix tests (because of esm module breaking jest)
- Loading branch information
Showing
7 changed files
with
13,881 additions
and
13,867 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,50 @@ | ||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
/** @type {import("ts-jest/dist/types").InitialOptionsTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'jsdom', | ||
preset: "ts-jest", | ||
testEnvironment: "jsdom", | ||
|
||
// The root of your source code | ||
roots: ['<rootDir>/src'], | ||
roots: [ "<rootDir>/src" ], | ||
|
||
// Target test tsconfig | ||
globals: { | ||
"ts-jest": { | ||
tsconfig: "<rootDir>/tsconfig.spec.json", | ||
"useESM": true | ||
} | ||
}, | ||
|
||
// Jest transformations -- this adds support for TypeScript using ts-jest | ||
transform: { | ||
'^.+\\.tsx?$': 'ts-jest', | ||
"^.+\\.tsx?$": "ts-jest" | ||
}, | ||
|
||
// Test spec file resolution pattern | ||
// Matches parent folder `__tests__` and filename should contain `test` or `spec`. | ||
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$', | ||
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$", | ||
|
||
// Minimum coverage thresholds | ||
// TODO : Increase threshold after implementing tests | ||
coverageThreshold: { | ||
global: { | ||
branches: 80, | ||
functions: 80, | ||
lines: 80, | ||
statements: 80, | ||
}, | ||
branches: 0, | ||
functions: 0, | ||
lines: 0, | ||
statements: 0 | ||
} | ||
}, | ||
|
||
// Module file extensions for importing | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | ||
moduleFileExtensions: [ "ts", "tsx", "js", "jsx", "json", "node" ], | ||
|
||
extensionsToTreatAsEsm: [ ".ts", ".tsx" ], | ||
// Webpack alias config= | ||
moduleNameMapper: { | ||
'^@src/(.*)$': '<rootDir>/src/$1', | ||
"^@src/(.*)$": "<rootDir>/src/$1" | ||
}, | ||
|
||
// Setup scripts before tests | ||
setupFilesAfterEnv: ['<rootDir>/test/setup.test.ts'], | ||
setupFilesAfterEnv: [ | ||
"<rootDir>/test/setup.test.ts" | ||
] | ||
}; |
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
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
File renamed without changes.
Oops, something went wrong.