Skip to content

Commit 20aa959

Browse files
authored
Merge pull request #123 from quannt/patch-1
Update vue-router's beforeRouteLeave
2 parents b08a718 + b67ae68 commit 20aa959

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/vue-router.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,10 @@ import mockModule from "@/bust-cache.js"
327327
jest.mock("@/bust-cache.js", () => ({ bustCache: jest.fn() }))
328328

329329
it("calls bustCache and next when leaving the route", () => {
330+
const wrapper = shallowMount(NestedRoute);
330331
const next = jest.fn()
331-
NestedRoute.beforeRouteLeave(undefined, undefined, next)
332+
NestedRoute.beforeRouteLeave.call(wrapper.vm, undefined, undefined, next)
333+
332334

333335
expect(mockModule.bustCache).toHaveBeenCalled()
334336
expect(next).toHaveBeenCalled()

0 commit comments

Comments
 (0)