-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
39 lines (36 loc) · 954 Bytes
/
jest.config.js
File metadata and controls
39 lines (36 loc) · 954 Bytes
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
const { loadEnv } = require("@medusajs/framework/utils")
loadEnv("test", process.cwd())
module.exports = {
transform: {
"^.+\\.[jt]sx?$": [
"@swc/jest",
{
jsc: {
parser: {
syntax: "typescript",
decorators: true,
tsx: true,
},
target: "es2021",
},
},
],
},
testEnvironment: "node",
moduleFileExtensions: ["js", "ts", "tsx", "jsx", "json"],
modulePathIgnorePatterns: ["dist/"],
setupFiles: ["./integration-tests/setup.js"],
}
if (process.env.TEST_TYPE === "integration:http") {
module.exports.testMatch = [
"**/integration-tests/http/*.spec.[jt]s",
]
} else if (process.env.TEST_TYPE === "integration:modules") {
module.exports.testMatch = [
"**/src/modules/*/__tests__/**/*.[jt]s",
]
} else if (process.env.TEST_TYPE === "unit") {
module.exports.testMatch = [
"**/src/**/__tests__/**/*.unit.spec.[jt]s",
]
}