加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
jest.config.js 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
module.exports = {
globals: {
__PATH_PREFIX__: '',
},
preset: 'ts-jest',
moduleNameMapper: {
'.+\\.(css|styl|less|sass|scss)$': 'identity-obj-proxy',
'.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/tests/__mocks__/file-mock.js',
'@components/(.*)$': '<rootDir>/src/components/$1',
'@layouts/(.*)$': '<rootDir>/src/layouts/$1',
'@content/(.*)$': '<rootDir>/src/content/$1',
'@images/(.*)$': '<rootDir>/src/assets/images/$1',
'@t/(.*)$': '<rootDir>/src/types/$1',
'@/(.*)$': '<rootDir>/src/$1',
},
setupFiles: ['<rootDir>/tests/loadershim.js'],
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/src/**/?(*.)+(test).[jt]s?(x)'],
testPathIgnorePatterns: ['node_modules', '\\.cache', '<rootDir>.*/public'],
testEnvironmentOptions: {
url: 'http://localhost:8000',
},
transform: {
'^.+\\.[jt]sx?$': '<rootDir>/tests/jest-preprocess.js',
},
transformIgnorePatterns: ['node_modules/(?!(gatsby)/)'],
setupFilesAfterEnv: ['<rootDir>/tests/jest.setup.js'],
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化