forked from langfuse/langfuse-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
27 lines (27 loc) · 928 Bytes
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
module.exports = {
roots: ["<rootDir>"],
testEnvironment: "node",
transform: {
"^.+\\.ts?$": [
"ts-jest",
{
tsconfig: {
lib: ["ES2021", "ES2022.Error", "DOM"], // We need to include DOM for tests
},
},
],
},
moduleFileExtensions: ["ts", "js", "json", "node"],
collectCoverage: true,
clearMocks: true,
coverageDirectory: "coverage",
fakeTimers: { enableGlobally: true },
transformIgnorePatterns: ["<rootDir>/node_modules/"],
testPathIgnorePatterns: ["<rootDir>/lib/", "/node_modules/", "/examples/"],
// we want to depend on the source version in the tests to get correct coverage
moduleNameMapper: {
"^(langfuse(?!-server).*)$": "<rootDir>/$1/index",
},
// we need to exclude the modules in the examples folder from the module lookup as they would collide
modulePathIgnorePatterns: ["<rootDir>/examples/", "<rootDir>/langfuse-server/"],
};