forked from Nutlope/turboseek
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjest.config.js
43 lines (43 loc) · 1.02 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* Custom Jest configuration to resolve dependency conflicts
* between canvas and jest-environment-jsdom
*/
module.exports = {
// Using the configuration from package.json and extending it
testEnvironment: "jsdom",
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
transform: {
"^.+\\.(t|j)sx?$": [
"@swc/jest",
{
jsc: {
transform: {
react: {
runtime: "automatic"
}
}
}
}
]
},
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/$1"
},
// Explicitly exclude canvas from transformation
transformIgnorePatterns: [
"node_modules/(?!(uuid|@solana/web3.js|canvas)/)"
],
// Prevent Jest from loading canvas module during tests
modulePathIgnorePatterns: [
"<rootDir>/node_modules/canvas"
],
testPathIgnorePatterns: [
"<rootDir>/node_modules/",
"<rootDir>/.next/",
"<rootDir>/e2e/"
],
// Handle peer dependency conflicts
resolver: undefined,
// Extend timeout for complex tests
testTimeout: 30000
};