Skip to content

Commit afe258c

Browse files
committed
feat: 增加 jest 单元测试套件以及第一个example组件单元测试
1 parent 4931041 commit afe258c

File tree

5 files changed

+3175
-58
lines changed

5 files changed

+3175
-58
lines changed

jest.config.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
moduleFileExtensions: ['js', 'jsx', 'json', 'vue', 'ts', 'tsx'],
3+
transform: {
4+
'^.+\\.vue$': 'vue-jest',
5+
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
6+
'jest-transform-stub',
7+
'^.+\\.tsx?$': 'ts-jest'
8+
},
9+
moduleNameMapper: {
10+
'^@/(.*)$': '<rootDir>/src/$1'
11+
},
12+
snapshotSerializers: ['jest-serializer-vue'],
13+
testMatch: [
14+
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
15+
],
16+
testURL: 'http://localhost/'
17+
};

0 commit comments

Comments
 (0)