Skip to content

fix router name :it should be wrapper.vm.$route.path not $router.path #923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2018
Merged

fix router name :it should be wrapper.vm.$route.path not $router.path #923

merged 1 commit into from
Aug 15, 2018

Conversation

Rudy24
Copy link
Contributor

@Rudy24 Rudy24 commented Aug 15, 2018

import { shallowMount } from '@vue/test-utils'

const $route = {
  path: '/some/path'
}

const wrapper = shallowMount(Component, {
  mocks: {
    $route
  }
})

wrapper.vm.$router.path // /some/path

it should be wrapper.vm.$route.path  not $router.path

[pls check issue link] (#905)

Copy link
Member

@eddyerburgh eddyerburgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)

@eddyerburgh eddyerburgh merged commit 5636a8e into vuejs:dev Aug 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants