Skip to content

Installing a Plugin on a Local Vue Instance Does Not Work on TypeScript #712

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

Closed
jbenner-radham opened this issue Jun 14, 2018 · 4 comments
Closed

Comments

@jbenner-radham
Copy link

Version

1.0.0-beta.18

Reproduction link

https://github.com/jbenner-radham/create-local-vue-ts-lab

Steps to reproduce

  1. Clone example repo.
  2. yarn install
  3. yarn test:unit

What is expected?

The unit tests will pass.

What is actually happening?

The unit tests are failing because the plugin installed on the localVue instance is not getting properly installed.


This isn't an issue when running on a normal Vue instance via yarn serve. And oddly it's not an issue in a JavaScript implementation, see here for an working JavaScript implementation example project.

@jbenner-radham
Copy link
Author

Some additional information I came across; apparently this is happening when I try and attach a mock to the mount as well e.g.

const $eventBus = new Vue();
const wrapper = shallowMount(ExampleComponent, {
    mocks: { $eventBus }
});

expect(wrapper.vm.$eventBus).to.exist;

Which raises:

AssertionError: expected undefined to exist

@eddyerburgh
Copy link
Member

I believe this has been fixed in #709. I'll release the fix in a few hours

@jbenner-radham
Copy link
Author

Awesome, thank you very much!

P.S. Thanks for the hard work you put in on a fantastic product for the community.

@eddyerburgh
Copy link
Member

Thanks :)

This should be fixed in beta.19

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

No branches or pull requests

2 participants