-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.browser.mjs
More file actions
37 lines (32 loc) · 1019 Bytes
/
jest.config.browser.mjs
File metadata and controls
37 lines (32 loc) · 1019 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
export default {
testEnvironment: 'jsdom',
moduleNameMapper: {
'^@yeez-tech/meta-encryptor$': '<rootDir>/node_modules/@yeez-tech/meta-encryptor/build/es/index.browser.js'
},
testMatch: [
"**/test/*.test.js"
],
roots: ['<rootDir>/test', '<rootDir>/src'],
moduleFileExtensions: ['mjs', 'js', 'json', 'jsx'],
// Use babel-jest for transforming test files; ESM mode controlled via globals
transform: {},
transformIgnorePatterns: [],
extensionsToTreatAsEsm: [],
// Keep node_modules mostly ignored; allow explicit transforms only when necessary.
/*
transformIgnorePatterns: [
'/node_modules/'
],
*/
globals: {
'process.env.BROWSER': true,
window: true, // 显式启用 window 全局对象
document: true // 显式启用 document 全局对象
},
testEnvironmentOptions: {
customExportConditions: ['node', 'module']
},
setupFilesAfterEnv: ["<rootDir>/jest.setup.browser.mjs"],
collectCoverage: true,
coverageDirectory: 'coverage/browser'
};