We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6bcf46 commit 47168efCopy full SHA for 47168ef
src/__tests__/vue-router-mocha.js
@@ -0,0 +1,16 @@
1
+import '@testing-library/jest-dom'
2
+import {render} from '@testing-library/vue'
3
+
4
+import About from './components/Router/About.vue'
5
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', () => {
10
+ return undefined
11
+ })
12
13
+ expect(() => render(About, {routes})).toThrowError(
14
+ new TypeError("Cannot read property 'default' of undefined"),
15
+ )
16
+})
0 commit comments