Skip to content

Commit 443b82d

Browse files
committed
chore(ci): add vue3 testing to pipeline
1 parent dee84c1 commit 443b82d

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,14 @@ jobs:
122122
- name: Test unit
123123
run: yarn run test:unit --coverage --maxWorkers=2
124124

125+
- name: Test unit (Vue 3)
126+
run: yarn run test:unit --coverage --maxWorkers=2
127+
env:
128+
USE_VUE3: '1'
129+
125130
- name: CodeCov
126131
uses: codecov/codecov-action@v2.1.0
127132
with:
128133
token: ${{ secrets.CODECOV_TOKEN }}
129134
flags: unittests
135+
files: ./coverage/clover.xml,./coverage-vue3/clover.xml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.vercel/
55
.vscode/
66
coverage/
7+
coverage-vue3/
78
dist/
89
docs-dist/
910
esm/

jest.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const useVue2 = 'USE_VUE2' in process.env
1+
const useVue3 = 'USE_VUE3' in process.env
22

3-
const moduleNameMapper = useVue2
4-
? {}
5-
: {
3+
const moduleNameMapper = useVue3
4+
? {
65
'^vue$': '@vue/compat',
76
'^@vue/test-utils$': '@vue/test-utils-vue3'
87
}
8+
: {}
99

1010
module.exports = {
1111
testRegex: 'spec.js$',
@@ -15,7 +15,7 @@ module.exports = {
1515
'^.+\\.js$': 'babel-jest'
1616
},
1717
transformIgnorePatterns: ['/node_modules(?![\\\\/]vue-test-utils-compat[\\\\/])'],
18-
coverageDirectory: './coverage/',
18+
coverageDirectory: useVue3 ? './coverage-vue3' : './coverage/',
1919
testEnvironmentOptions: {
2020
pretendToBeVisual: true
2121
},

tests/setup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import Vue from 'vue'
33
import * as VTU from '@vue/test-utils'
44
import { installCompat as installVTUCompat, fullCompatConfig } from 'vue-test-utils-compat'
55

6-
const useVue2 = 'USE_VUE2' in process.env
7-
if (!useVue2) {
6+
const useVue3 = 'USE_VUE3' in process.env
7+
if (useVue3) {
88
Vue.configureCompat({
99
MODE: 2,
1010
ATTR_FALSE_VALUE: 'suppress-warning',

0 commit comments

Comments
 (0)