Skip to content

Commit 5429560

Browse files
committed
Reenable vue router mocha test
1 parent 0589b44 commit 5429560

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

src/__tests__/vue-router-mocha.js

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
test.todo('Your test suite must contain at least one test.')
1+
import '@testing-library/jest-dom'
2+
import {render} from '..'
23

3-
// import '@testing-library/jest-dom'
4-
// import {render} from '..'
4+
import About from './components/Router/About.vue'
55

6-
// import About from './components/Router/About.vue'
6+
const routes = []
7+
test('uses require("vue-router").default when require("vue-router") is undefined (useful for mocha users)', () => {
8+
// Test for fix https://github.com/testing-library/vue-testing-library/issues/119
9+
jest.mock('vue-router', () => undefined)
710

8-
// const routes = []
9-
// test('uses require("vue-router").default when require("vue-router") is undefined (useful for mocha users)', () => {
10-
// // Test for fix https://github.com/testing-library/vue-testing-library/issues/119
11-
// jest.mock('vue-router', () => {
12-
// return undefined
13-
// })
14-
15-
// expect(() => render(About, {routes})).toThrowError(
16-
// new TypeError("Cannot read property 'default' of undefined"),
17-
// )
18-
// })
11+
expect(() => render(About, {routes})).toThrowError(
12+
new TypeError("Cannot read property 'default' of undefined"),
13+
)
14+
})

0 commit comments

Comments
 (0)