-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathjest.config.base.js
More file actions
33 lines (30 loc) · 911 Bytes
/
Copy pathjest.config.base.js
File metadata and controls
33 lines (30 loc) · 911 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
const path = require('path')
const { loadEnv } = require('@medusajs/utils')
loadEnv('test', path.resolve(__dirname))
const base = {
transform: {
'^.+\\.[jt]sx?$': [
'@swc/jest',
{
jsc: {
parser: { syntax: 'typescript', tsx: true, decorators: true },
transform: { decoratorMetadata: true }
}
}
]
},
transformIgnorePatterns: [
'node_modules/(?!(@react-email)/)'
],
testEnvironment: 'node',
moduleFileExtensions: ['js', 'ts', 'json', 'tsx'],
modulePathIgnorePatterns: ['dist/', '<rootDir>/.medusa/']
}
if (process.env.TEST_TYPE === 'integration:http') {
base.testMatch = ['**/integration-tests/http/*.spec.[jt]s']
} else if (process.env.TEST_TYPE === 'integration:modules') {
base.testMatch = ['**/src/modules/*/__tests__/**/*.[jt]s']
} else if (process.env.TEST_TYPE === 'unit') {
base.testMatch = ['**/src/**/__tests__/**/*.unit.spec.[jt]s']
}
module.exports = base