Skip to content

Commit 5be87d2

Browse files
committed
Add ts-jest settings
1 parent 7c15b60 commit 5be87d2

10 files changed

+8923
-3826
lines changed

api/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1+
import { renderStatsCard } from "@/src/cards/stats-card";
2+
import blacklist from "@/src/common/blacklist";
13
import {
24
clampValue,
35
CONSTANTS,
4-
isLocaleAvailable,
56
parseArray,
67
parseBoolean,
78
renderError,
8-
} from "@/index.js";
9-
import renderStatsCard from "@/src/cards/stats-card";
10-
import blacklist from "@/src/common/blacklist";
9+
} from "@/src/common/utils";
1110
import fetchStats from "@/src/fetchers/stats-fetcher";
11+
import { isLocaleAvailable } from "@/src/translations";
1212
import * as dotenv from "dotenv";
1313
import express from "express";
1414

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
presets: ["@babel/preset-env"],
3+
};

jest.config.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
export default {
2+
transform: {
3+
"^.+\\.[t|j]s$": [
4+
"ts-jest",
5+
{
6+
useESM: true,
7+
},
8+
],
9+
},
10+
extensionsToTreatAsEsm: [".ts"],
211
clearMocks: true,
3-
transform: {},
412
testEnvironment: "jsdom",
513
coverageProvider: "v8",
614
testPathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/tests/e2e/"],
@@ -9,4 +17,8 @@ export default {
917
"<rootDir>/node_modules/",
1018
"<rootDir>/tests/E2E/",
1119
],
20+
moduleNameMapper: {
21+
"^@/(.*)$": "<rootDir>/$1",
22+
},
23+
modulePaths: ["<rootDir>"],
1224
};

0 commit comments

Comments
 (0)