Skip to content

Commit 411e0e9

Browse files
committed
chore(ci): add vue3 testing to pipeline
1 parent 7e16f96 commit 411e0e9

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,19 @@ jobs:
125125
- name: Test unit
126126
run: yarn run test:unit --coverage --maxWorkers=2
127127

128+
- name: Test unit (Vue 3)
129+
run: yarn run test:unit --coverage --maxWorkers=2
130+
env:
131+
USE_VUE3: '1'
132+
133+
- name: Merge coverage
134+
run:
135+
npx istanbul-merge --out ./coverage-final.json coverage/coverage-final.json
136+
coverage-vue3/coverage-final.json
137+
128138
- name: CodeCov
129139
uses: codecov/codecov-action@v3.1.1
130140
with:
131141
token: ${{ secrets.CODECOV_TOKEN }}
132142
flags: unittests
143+
files: ./coverage-final.json

.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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy