feat(cli): bump jest v29 (#11117)

This commit is contained in:
neverland 2022-10-06 17:01:29 +08:00 committed by GitHub
parent f94897cb24
commit 711652ad90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 603 additions and 546 deletions

View File

@ -6,9 +6,10 @@
对以下依赖进行了大版本升级: 对以下依赖进行了大版本升级:
- vite v3 - vite: 由 v2 升级至 v3
- @vitejs/plugin-vue v3 - jest: 由 v27 升级至 v29
- @vitejs/plugin-vue-jsx v2 - @vitejs/plugin-vue: 由 v2 升级至 v3
- @vitejs/plugin-vue-jsx: 由 v1 升级至 v2
### 依赖精简 ### 依赖精简

View File

@ -29,6 +29,10 @@ const DEFAULT_CONFIG = {
], ],
coverageReporters: ['html', 'lcov', 'text-summary'], coverageReporters: ['html', 'lcov', 'text-summary'],
coverageDirectory: './test/coverage', coverageDirectory: './test/coverage',
testEnvironmentOptions: {
// https://stackoverflow.com/questions/72428323/jest-referenceerror-vue-is-not-defined
customExportConditions: ['node', 'node-addons'],
},
}; };
function readRootConfig() { function readRootConfig() {

View File

@ -87,6 +87,8 @@ module.exports = {
if (isJsxFile(path)) { if (isJsxFile(path)) {
code = transformJsx(code, path); code = transformJsx(code, path);
} }
return transformScript(code); return {
code: transformScript(code)
};
}, },
}; };

View File

@ -39,7 +39,7 @@
"author": "chenjiahan", "author": "chenjiahan",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@jest/types": "^27.5.1", "@jest/types": "^29.1.2",
"@types/fs-extra": "^9.0.13", "@types/fs-extra": "^9.0.13",
"@types/less": "^3.0.3", "@types/less": "^3.0.3",
"@types/markdown-it": "^12.2.3", "@types/markdown-it": "^12.2.3",
@ -52,7 +52,7 @@
"@babel/preset-typescript": "^7.18.6", "@babel/preset-typescript": "^7.18.6",
"@docsearch/css": "^3.2.1", "@docsearch/css": "^3.2.1",
"@docsearch/js": "^3.2.1", "@docsearch/js": "^3.2.1",
"@types/jest": "^27.5.2", "@types/jest": "^29.1.1",
"@vant/eslint-config": "^3.5.0", "@vant/eslint-config": "^3.5.0",
"@vant/touch-emulator": "^1.4.0", "@vant/touch-emulator": "^1.4.0",
"@vitejs/plugin-vue": "^3.0.3", "@vitejs/plugin-vue": "^3.0.3",
@ -70,9 +70,10 @@
"hash-sum": "^2.0.0", "hash-sum": "^2.0.0",
"highlight.js": "^11.6.0", "highlight.js": "^11.6.0",
"husky": "^8.0.1", "husky": "^8.0.1",
"jest": "^27.5.1", "jest": "^29.1.2",
"jest-canvas-mock": "^2.4.0", "jest-canvas-mock": "^2.4.0",
"jest-serializer-html": "^7.1.0", "jest-serializer-html": "^7.1.0",
"jest-environment-jsdom": "^29.1.2",
"less": "^4.1.3", "less": "^4.1.3",
"markdown-it": "^12.3.2", "markdown-it": "^12.3.2",
"markdown-it-anchor": "^8.6.4", "markdown-it-anchor": "^8.6.4",

View File

@ -55,7 +55,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^16.11.56", "@types/node": "^16.11.56",
"@types/jest": "^27.0.0", "@types/jest": "^29.1.1",
"@vant/area-data": "workspace:*", "@vant/area-data": "workspace:*",
"@vant/cli": "workspace:*", "@vant/cli": "workspace:*",
"@vant/eslint-config": "workspace:*", "@vant/eslint-config": "workspace:*",

1125
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff