-
Notifications
You must be signed in to change notification settings - Fork 62
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
Feature Request: ComponentStub helper #85
Comments
@chrisnicola this looks good, although I would call it I'd be happy to accept a PR for this feature, if you add it to the docs, and includes tests in your PR Right now I'm in the process of writing the official const wrapper = mount(Component, {
stub: {
'router-link': '<div />',
'router-view': '<div />'
}
}) Although I'm planning on adding the option to just pass true, so that a standard stub is used (similar to what your const wrapper = mount(Component, {
stub: {
'router-link': '<div />',
'router-view': '<div />'
}
}) You can see the code here - https://github.com/vuejs/vue-test-utils/blob/master/src/lib/create-instance.js#L34 |
Sorry you're right on the name, initially I named it based on just exporting single stub, but realized that was kind of verbose in the tests and I could add a nice helper function. Failed to rename it afterwards. I really like that API for |
@chrisnicola yes good idea on the array for |
@eddyerburgh, so, this library will soon be deprecated? |
@ndabAP no I'll continue to support and evolve it, but most of my time will be spent on vue-test-utils |
I've added this helper in my own codebase, but if useful to this project I'm happy to submit a PR. The code is below.
Usage is simple:
As a small bonus it provides stub telemetry for the render function.
The text was updated successfully, but these errors were encountered: