Skip to content

Commit dede199

Browse files
committed
fix: Update workflow to release 5.x
1 parent c00fe77 commit dede199

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

.github/workflows/validate.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
branches:
55
[
66
'+([0-9])?(.{+([0-9]),x}).x',
7+
'5.x',
78
'main',
89
'next',
910
'next-major',
@@ -44,16 +45,16 @@ jobs:
4445
runs-on: ubuntu-latest
4546
if:
4647
${{ github.repository == 'testing-library/vue-testing-library' &&
47-
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
48+
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha,refs/heads/5.x',
4849
github.ref) && github.event_name == 'push' }}
4950
steps:
5051
- name: ⬇️ Checkout repo
51-
uses: actions/checkout@v2
52+
uses: actions/checkout@v3
5253

5354
- name: ⎔ Setup node
54-
uses: actions/setup-node@v2
55+
uses: actions/setup-node@v3
5556
with:
56-
node-version: 14
57+
node-version: 16
5758

5859
- name: 📥 Download deps
5960
uses: bahmutov/npm-install@v1
@@ -64,12 +65,13 @@ jobs:
6465
run: npm run build
6566

6667
- name: 🚀 Release
67-
uses: cycjimmy/semantic-release-action@v2
68+
uses: cycjimmy/semantic-release-action@v3
6869
with:
6970
semantic_version: 17
7071
branches: |
7172
[
7273
'+([0-9])?(.{+([0-9]),x}).x',
74+
'5.x',
7375
'main',
7476
'next',
7577
'next-major',
+10-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
/* eslint-disable jest/no-conditional-in-test */
2+
/* eslint-disable jest/no-conditional-expect */
3+
24
import '@testing-library/jest-dom'
35
import {render} from '@testing-library/vue'
4-
import semver from 'semver'
56

67
import About from './components/Router/About.vue'
78

89
const routes = []
910
test('uses require("vue-router").default when require("vue-router") is undefined (useful for mocha users)', () => {
11+
expect.assertions(2)
12+
1013
// Test for fix https://github.com/testing-library/vue-testing-library/issues/119
1114
jest.mock('vue-router', () => {
1215
return undefined
1316
})
1417

15-
expect(() => render(About, {routes})).toThrowError(
16-
new TypeError(
17-
semver.gte(process.version, '16.0.0')
18-
? "Cannot read properties of undefined (reading 'default')"
19-
: "Cannot read property 'default' of undefined",
20-
),
21-
)
18+
try {
19+
render(About, {routes})
20+
} catch (error) {
21+
expect(error).toBeInstanceOf(TypeError)
22+
expect(error.message).toEqual(expect.stringContaining('default'))
23+
}
2224
})

0 commit comments

Comments
 (0)