Skip to content

Commit 22a536d

Browse files
committed
test: add travis
1 parent 5f242ad commit 22a536d

File tree

5 files changed

+1697
-65
lines changed

5 files changed

+1697
-65
lines changed

Diff for: β€Ž.travis.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: node_js
2+
node_js:
3+
- 10.15.0
4+
cache: yarn
5+
script:
6+
- yarn
7+
- yarn run build

Diff for: β€Žjest.config.js

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

Diff for: β€Žpackage.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"scripts": {
66
"serve": "vue-cli-service serve",
77
"build": "vue-cli-service build",
8-
"lint": "vue-cli-service lint"
8+
"lint": "vue-cli-service lint",
9+
"test:unit": "vue-cli-service test:unit"
910
},
1011
"dependencies": {
1112
"@antv/data-set": "^0.10.1",
@@ -29,9 +30,13 @@
2930
"devDependencies": {
3031
"@vue/cli-plugin-babel": "^3.2.0",
3132
"@vue/cli-plugin-eslint": "^3.2.0",
33+
"@vue/cli-plugin-unit-jest": "^3.3.0",
3234
"@vue/cli-service": "^3.2.0",
3335
"@vue/eslint-config-standard": "^4.0.0",
36+
"@vue/test-utils": "^1.0.0-beta.20",
37+
"babel-core": "7.0.0-bridge.0",
3438
"babel-eslint": "^10.0.1",
39+
"babel-jest": "^23.6.0",
3540
"eslint": "^5.8.0",
3641
"eslint-plugin-vue": "^5.0.0-0",
3742
"less": "^3.8.1",

Diff for: β€Žtests/unit/.eslintrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
env: {
3+
jest: true
4+
}
5+
}

0 commit comments

Comments
Β (0)