mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[Improvement] Test: separate jest config from packages.json (#1218)
This commit is contained in:
parent
caf2c6d16c
commit
1a43eb7951
23
jest.config.js
Normal file
23
jest.config.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
module.exports = {
|
||||||
|
moduleFileExtensions: ['js', 'vue'],
|
||||||
|
transform: {
|
||||||
|
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
|
||||||
|
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
|
||||||
|
},
|
||||||
|
moduleNameMapper: {
|
||||||
|
'^packages/(.*)$': '<rootDir>/packages/$1'
|
||||||
|
},
|
||||||
|
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
|
||||||
|
collectCoverageFrom: [
|
||||||
|
'packages/**/*.{js,vue}',
|
||||||
|
'!**/vant-css/**',
|
||||||
|
'!**/demo/**',
|
||||||
|
'!**/locale/lang/**',
|
||||||
|
'!**/waterfall/**',
|
||||||
|
'!**/sku/**',
|
||||||
|
'!**/lazyload/**'
|
||||||
|
],
|
||||||
|
collectCoverage: true,
|
||||||
|
coverageReporters: ['html', 'lcov', 'text-summary'],
|
||||||
|
coverageDirectory: './test/coverage'
|
||||||
|
};
|
43
package.json
43
package.json
@ -57,7 +57,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/server-test-utils": "^1.0.0-beta.16",
|
"@vue/server-test-utils": "^1.0.0-beta.16",
|
||||||
"@vue/test-utils": "^1.0.0-beta.16",
|
"@vue/test-utils": "^1.0.0-beta.16",
|
||||||
"autoprefixer": "^8.5.2",
|
"autoprefixer": "^8.6.0",
|
||||||
"babel-cli": "^6.26.0",
|
"babel-cli": "^6.26.0",
|
||||||
"babel-core": "^6.26.3",
|
"babel-core": "^6.26.3",
|
||||||
"babel-jest": "^23.0.1",
|
"babel-jest": "^23.0.1",
|
||||||
@ -71,13 +71,14 @@
|
|||||||
"dependency-tree": "^6.1.0",
|
"dependency-tree": "^6.1.0",
|
||||||
"eslint": "^4.19.1",
|
"eslint": "^4.19.1",
|
||||||
"eslint-plugin-vue": "^4.5.0",
|
"eslint-plugin-vue": "^4.5.0",
|
||||||
|
"fast-glob": "^2.2.2",
|
||||||
"fast-vue-md-loader": "^1.0.3",
|
"fast-vue-md-loader": "^1.0.3",
|
||||||
"gh-pages": "^1.0.0",
|
"gh-pages": "^1.2.0",
|
||||||
"html-webpack-plugin": "3.2.0",
|
"html-webpack-plugin": "3.2.0",
|
||||||
"husky": "^0.14.3",
|
"husky": "^0.14.3",
|
||||||
"jest": "^23.1.0",
|
"jest": "^23.1.0",
|
||||||
"jest-serializer-vue": "^2.0.0",
|
"jest-serializer-vue": "^2.0.0",
|
||||||
"lint-staged": "^7.1.2",
|
"lint-staged": "^7.1.3",
|
||||||
"postcss": "^6.0.22",
|
"postcss": "^6.0.22",
|
||||||
"postcss-calc": "^6.0.0",
|
"postcss-calc": "^6.0.0",
|
||||||
"postcss-easy-import": "^3.0.0",
|
"postcss-easy-import": "^3.0.0",
|
||||||
@ -93,46 +94,14 @@
|
|||||||
"vant-doc": "1.0.6",
|
"vant-doc": "1.0.6",
|
||||||
"vue": "2.5.16",
|
"vue": "2.5.16",
|
||||||
"vue-jest": "^2.6.0",
|
"vue-jest": "^2.6.0",
|
||||||
"vue-loader": "^15.2.2",
|
"vue-loader": "^15.2.4",
|
||||||
"vue-router": "^3.0.1",
|
"vue-router": "^3.0.1",
|
||||||
"vue-server-renderer": "^2.5.16",
|
"vue-server-renderer": "^2.5.16",
|
||||||
"vue-sfc-compiler": "^0.0.8",
|
"vue-sfc-compiler": "^0.0.8",
|
||||||
"vue-template-compiler": "2.5.16",
|
"vue-template-compiler": "2.5.16",
|
||||||
"vue-template-es2015-compiler": "^1.6.0",
|
"vue-template-es2015-compiler": "^1.6.0",
|
||||||
"webpack": "^4.10.2",
|
"webpack": "^4.10.2",
|
||||||
"webpack-cli": "^2.1.4",
|
"webpack-cli": "^3.0.1",
|
||||||
"webpack-serve": "^1.0.2"
|
"webpack-serve": "^1.0.2"
|
||||||
},
|
|
||||||
"jest": {
|
|
||||||
"moduleFileExtensions": [
|
|
||||||
"js",
|
|
||||||
"vue"
|
|
||||||
],
|
|
||||||
"transform": {
|
|
||||||
"^.+\\.js$": "<rootDir>/node_modules/babel-jest",
|
|
||||||
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest"
|
|
||||||
},
|
|
||||||
"moduleNameMapper": {
|
|
||||||
"^packages/(.*)$": "<rootDir>/packages/$1"
|
|
||||||
},
|
|
||||||
"snapshotSerializers": [
|
|
||||||
"<rootDir>/node_modules/jest-serializer-vue"
|
|
||||||
],
|
|
||||||
"collectCoverageFrom": [
|
|
||||||
"packages/**/*.{js,vue}",
|
|
||||||
"!**/vant-css/**",
|
|
||||||
"!**/demo/**",
|
|
||||||
"!**/locale/lang/**",
|
|
||||||
"!**/waterfall/**",
|
|
||||||
"!**/sku/**",
|
|
||||||
"!**/lazyload/**"
|
|
||||||
],
|
|
||||||
"collectCoverage": true,
|
|
||||||
"coverageReporters": [
|
|
||||||
"html",
|
|
||||||
"lcov",
|
|
||||||
"text-summary"
|
|
||||||
],
|
|
||||||
"coverageDirectory": "./test/coverage"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user