mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 19:10:55 +00:00
2524a4f00c
## Description: Switches away from ts-jest in favor of @swc/jest. On my local I observe a ten-fold decrease in how long it takes the test suite to run. No changes are required to how our existing tests are written. Benchmarking old: 24.658s new: 2.268s ts-jest (old) ``` Test Suites: 29 passed, 29 total Tests: 215 passed, 215 total Snapshots: 0 total Time: 24.658 s Ran all test suites. ``` swc-jest (new) ``` Test Suites: 29 passed, 29 total Tests: 215 passed, 215 total Snapshots: 0 total Time: 2.268 s Ran all test suites. ``` Fixes #1679 ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I have read and accepted the CLA agreement (only required once). ## Please put your Discord username so you can be contacted if a bug or regression is found: slyty
27 lines
807 B
TypeScript
27 lines
807 B
TypeScript
export default {
|
|
testEnvironment: "node",
|
|
testRegex: "/tests/.*\\.(test|spec)?\\.(ts|tsx)$",
|
|
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
|
|
extensionsToTreatAsEsm: [".ts"],
|
|
moduleNameMapper: {
|
|
"^(\\.{1,2}/.*)\\.js$": "$1",
|
|
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
|
|
"<rootDir>/__mocks__/fileMock.js",
|
|
"\\.(css|less)$": "<rootDir>/__mocks__/fileMock.js",
|
|
},
|
|
transform: {
|
|
"^.+\\.tsx?$": ["@swc/jest"],
|
|
},
|
|
transformIgnorePatterns: ["node_modules/(?!(node:)/)"],
|
|
collectCoverageFrom: ["src/**/*.ts", "!src/**/*.d.ts"],
|
|
coverageThreshold: {
|
|
global: {
|
|
statements: 21.5,
|
|
branches: 17.0,
|
|
lines: 22.0,
|
|
functions: 20.5,
|
|
},
|
|
},
|
|
coverageReporters: ["text", "lcov", "html"],
|
|
};
|