mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-02 03:08:21 +08:00
feat: add jest basic config
This commit is contained in:
parent
0c483880ad
commit
b42f434c1e
16
jest.config.js
Normal file
16
jest.config.js
Normal file
@ -0,0 +1,16 @@
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
globals: {
|
||||
// work around: https://github.com/kulshekhar/ts-jest/issues/748#issuecomment-423528659
|
||||
'ts-jest': {
|
||||
diagnostics: {
|
||||
ignoreCodes: [151001],
|
||||
},
|
||||
},
|
||||
},
|
||||
testEnvironment: 'jsdom',
|
||||
transform: {
|
||||
"^.+\\.vue$": "vue-jest"
|
||||
},
|
||||
moduleFileExtensions: ['vue', 'json', 'ts', 'tsx', 'js', 'json']
|
||||
}
|
@ -6,6 +6,7 @@
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"cz": "npx git-cz",
|
||||
"test": "lerna run test --stream",
|
||||
"gc": "sh ./scripts/gc.sh"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -13,9 +14,11 @@
|
||||
"vue-router": "^4.0.0-beta.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.7",
|
||||
"@vue/compiler-sfc": "^3.0.0-rc.1",
|
||||
"cz-conventional-changelog": "^3.2.0",
|
||||
"lerna": "^3.22.1",
|
||||
"typescript": "^3.9.7",
|
||||
"vite": "^1.0.0-rc.1"
|
||||
},
|
||||
"config": {
|
||||
|
6
packages/button/__tests__/button.spec.ts
Normal file
6
packages/button/__tests__/button.spec.ts
Normal file
@ -0,0 +1,6 @@
|
||||
describe('Button.vue', () => {
|
||||
test('hello world', () => {
|
||||
const bestGirl = 'Rem'
|
||||
expect(bestGirl).not.toMatch('Emilia')
|
||||
})
|
||||
})
|
@ -3,7 +3,16 @@
|
||||
"version": "0.0.0",
|
||||
"main": "dist/index.js",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "jest --config ../../jest.config.js --rootDir ."
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/test-utils": "^2.0.0-beta.0",
|
||||
"jest": "^26.1.0",
|
||||
"ts-jest": "^26.1.3",
|
||||
"vue-jest": "5.0.0-alpha.1"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user