23 Star 125 Fork 24

DiDi-opensource / mand-mobile

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
jest.config.js 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
高健 提交于 2019-04-09 17:53 . test(ruler): add ruler jest test (#395)
const TEST_TYPE = process.env.TEST_TYPE || 'components'
// const TEST_BUNDLE = TEST_TYPE === 'bundle' ? 'lib/mand-mobile.umd' : ''
module.exports = {
setupFiles: ['jest-canvas-mock', '<rootDir>/test/jest.init.js'],
moduleFileExtensions: [
'js',
'json',
'vue'
],
transform: {
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$':
'jest-transform-stub',
'^.+\\.js$': 'babel-jest',
'.*\\.vue$': 'vue-jest',
'^.+\\.svg$': 'jest-svg-sprite-loader'
},
globals: {
'vue-jest': {
babelConfig: {
configFile: '<rootDir>/.babelrc'
}
}
},
modulePaths: [
'<rootDir>/components',
'<rootDir>/node_modules'
],
moduleNameMapper: {
'@examples(.*)': '<rootDir>/examples/$1',
'mand-mobile/lib(.*)': `<rootDir>/${TEST_TYPE}$1`,
'mand-mobile/components/picker/demo/data(.*)': '<rootDir>/components/picker/demo/data/$1',
'mand-mobile/components/tab-picker/demo/data(.*)': '<rootDir>/components/tab-picker/demo/data/$1',
'mand-mobile/components(.*)': `<rootDir>/${TEST_TYPE}$1`
},
snapshotSerializers: [
'jest-serializer-vue'
],
collectCoverage: true,
collectCoverageFrom: [
'components/*/*.{js,vue}'
],
coverageReporters: ['html', 'lcov', 'text-summary'],
coverageDirectory: './test/coverage'
}
JavaScript
1
https://gitee.com/didiopensource/mand-mobile.git
git@gitee.com:didiopensource/mand-mobile.git
didiopensource
mand-mobile
mand-mobile
master

搜索帮助