Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5838cc2

Browse files
committed
Update readme to reflect 5.x supports Vue 2
1 parent 4d4a8df commit 5838cc2

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

‎README.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div align="center">
2-
<h1>Vue Testing Library</h1>
2+
<h1>Vue Testing Library for Vue 2</h1>
33

44
<br />
55

@@ -15,11 +15,12 @@
1515
<p>Simple and complete Vue.js testing utilities that encourage good testing practices.</p>
1616

1717
<p>Vue Testing Library is a lightweight adapter built on top of <a href="https://github.com/testing-library/dom-testing-library/">DOM Testing Library</a> and <a href="https://github.com/vuejs/vue-test-utils">@vue/test-utils</a>.</p>
18-
19-
18+
2019
<br />
21-
22-
<p>If you're looking for the Vue 3 version of Vue Testing Library, check out the <a href="https://github.com/testing-library/vue-testing-library/tree/next">next</a> branch.</p>
20+
21+
<p>If you're looking for the Vue 3 version of Vue Testing Library, check out the <a href="https://github.com/testing-library/vue-testing-library/tree/main">main</a> branch.</p>
22+
23+
<p>Vue Testing Library support Vue 2 in its 5.x version range. Bear in mind that it means that <strong>any version bump in the 5.x range may include breaking changes</strong>.</p>
2324

2425
<br />
2526

@@ -66,16 +67,10 @@
6667
This module is distributed via `npm` and should be installed as one of your
6768
project's `devDependencies`:
6869

69-
If using Vue 2
7070
```
7171
npm install --save-dev @testing-library/vue@5
7272
```
7373

74-
If using Vue 3
75-
```
76-
npm install --save-dev @testing-library/vue
77-
```
78-
7974
This library has `peerDependencies` listings for `Vue` and
8075
`vue-template-compiler`.
8176

‎src/__tests__/about-vue-router-mocha.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import '@testing-library/jest-dom'
22
import {render} from '@testing-library/vue'
3+
import semver from 'semver'
34

45
import About from './components/Router/About.vue'
56

@@ -11,6 +12,10 @@ test('uses require("vue-router").default when require("vue-router") is undefined
1112
})
1213

1314
expect(() => render(About, {routes})).toThrowError(
14-
new TypeError("Cannot read property 'default' of undefined"),
15+
new TypeError(
16+
semver.gte(process.version, '16.0.0')
17+
? "Cannot read properties of undefined (reading 'default')"
18+
: "Cannot read property 'default' of undefined",
19+
),
1520
)
1621
})

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /