mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
feat: drop jest (#7248)
* feat: drop jest * test: remove ssr * test: rename * chore: update tsconfig
This commit is contained in:
parent
de0ee53cf0
commit
1d13ebb05d
6
.github/renovate.json5
vendored
6
.github/renovate.json5
vendored
@ -17,11 +17,7 @@
|
||||
// pure esm
|
||||
'chalk',
|
||||
|
||||
// jest
|
||||
'@types/jest',
|
||||
'babel-jest',
|
||||
'jest',
|
||||
'ts-jest',
|
||||
// test
|
||||
'@vue/test-utils',
|
||||
|
||||
'cypress',
|
||||
|
2
.github/workflows/test-coverage.yml
vendored
2
.github/workflows/test-coverage.yml
vendored
@ -50,4 +50,4 @@ jobs:
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
skip-step: install
|
||||
test-script: pnpm run test:jest
|
||||
test-script: pnpm run test:coverage
|
||||
|
2
.github/workflows/test-unit.yml
vendored
2
.github/workflows/test-unit.yml
vendored
@ -46,4 +46,4 @@ jobs:
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
- name: Test
|
||||
run: pnpm test:jest && pnpm test:vitest
|
||||
run: pnpm test
|
||||
|
@ -1,8 +0,0 @@
|
||||
// For jest use only
|
||||
module.exports = {
|
||||
presets: [
|
||||
['@babel/preset-env', { targets: { node: 'current' } }],
|
||||
'@babel/preset-typescript',
|
||||
],
|
||||
plugins: ['@vue/babel-plugin-jsx'],
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
const transfomer = require('vue-jest')
|
||||
const { transform } = require('unplugin-vue-define-options')
|
||||
|
||||
module.exports = {
|
||||
getCacheKey: transfomer.getCacheKey,
|
||||
process(src, filename, config) {
|
||||
src = transform(src, filename)?.code || src
|
||||
return transfomer.process(src, filename, config)
|
||||
},
|
||||
}
|
@ -6,9 +6,6 @@ module.exports = defineConfig({
|
||||
browser: true,
|
||||
node: true,
|
||||
},
|
||||
globals: {
|
||||
jest: 'readonly',
|
||||
},
|
||||
plugins: ['@typescript-eslint', 'prettier', 'unicorn'],
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
|
@ -1,23 +0,0 @@
|
||||
/**
|
||||
* @type import('@jest/types').Config.InitialOptions
|
||||
*/
|
||||
module.exports = {
|
||||
setupFiles: ['./jest.setup.js'],
|
||||
testMatch: [
|
||||
'**/__tests__/**/*.[jt]s?(x)',
|
||||
'**/?(*.)+(spec|test).[jt]s?(x)',
|
||||
'!**/**vitest**',
|
||||
'!**/table-test-common.ts',
|
||||
],
|
||||
testPathIgnorePatterns: ['/node_modules/', 'dist'],
|
||||
modulePathIgnorePatterns: ['/node_modules/', 'dist', 'cypress'],
|
||||
testEnvironment: 'jsdom',
|
||||
transform: {
|
||||
'\\.[jt]sx?$': 'babel-jest',
|
||||
'^.+\\.vue$': '<rootDir>/internal/build/vue-jest-transformer.js',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'vue'],
|
||||
// u can change this option to a more specific folder for test single component or util when dev
|
||||
// for example, ['<rootDir>/packages/components/input']
|
||||
roots: ['<rootDir>'],
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
const { config } = require('@vue/test-utils')
|
||||
const _ResizeObserver = require('resize-observer-polyfill')
|
||||
|
||||
config.global.stubs = {}
|
||||
|
||||
global.ResizeObserver = _ResizeObserver
|
||||
process.addListener('unhandledRejection', (err) => console.error(err))
|
10
package.json
10
package.json
@ -8,9 +8,7 @@
|
||||
],
|
||||
"scripts": {
|
||||
"cz": "git-cz",
|
||||
"test": "pnpm test:jest && pnpm test:vitest",
|
||||
"test:jest": "jest",
|
||||
"test:vitest": "vitest",
|
||||
"test": "vitest",
|
||||
"test:coverage": "vitest --coverage",
|
||||
"test:ssr": "rimraf ./ssr-testing/screenshots/* && vitest --config ./ssr-testing/vitest.config.ts",
|
||||
"prepare:e2e": "if [ ! -d \"docs/.vitepress/dist\" ]; then pnpm run docs:build; fi;",
|
||||
@ -77,7 +75,6 @@
|
||||
"@pnpm/types": "^8.0.0",
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
"@types/gulp": "^4.0.9",
|
||||
"@types/jest": "^26.0.24",
|
||||
"@types/node": "*",
|
||||
"@types/sass": "^1.43.1",
|
||||
"@vitejs/plugin-vue": "^2.3.1",
|
||||
@ -86,7 +83,6 @@
|
||||
"@vue/babel-plugin-jsx": "^1.1.1",
|
||||
"@vue/test-utils": "2.0.0-rc.16",
|
||||
"@vue/tsconfig": "^0.1.3",
|
||||
"babel-jest": "^26.6.3",
|
||||
"c8": "^7.11.0",
|
||||
"chalk": "^4.1.2",
|
||||
"concurrently": "^7.1.0",
|
||||
@ -98,7 +94,7 @@
|
||||
"expect-type": "^0.13.0",
|
||||
"fast-glob": "^3.2.11",
|
||||
"husky": "^7.0.4",
|
||||
"jest": "^26.6.3",
|
||||
"jsdom": "16.4.0",
|
||||
"lint-staged": "^12.3.8",
|
||||
"prettier": "^2.6.2",
|
||||
"pretty-quick": "^3.1.3",
|
||||
@ -107,7 +103,6 @@
|
||||
"rimraf": "^3.0.2",
|
||||
"sass": "^1.50.0",
|
||||
"sucrase": "^3.21.0",
|
||||
"ts-jest": "^26.5.6",
|
||||
"ts-morph": "^14.0.0",
|
||||
"type-fest": "^2.12.2",
|
||||
"typescript": "^4.6.3",
|
||||
@ -115,7 +110,6 @@
|
||||
"unplugin-vue-define-options": "^0.6.0",
|
||||
"vitest": "^0.9.3",
|
||||
"vue": "3.2.31",
|
||||
"vue-jest": "^5.0.0-alpha.10",
|
||||
"vue-router": "^4.0.14",
|
||||
"vue-tsc": "^0.34.7"
|
||||
},
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user