testing-library / vue-testing-library

🦎 Simple and complete Vue.js testing utilities that encourage good testing practices.
http://testing-library.com/vue
MIT License
1.08k stars 109 forks source link

Syntax in vue-router example appears deprecated? #258

Closed FlorentBuissonOReilly closed 3 years ago

FlorentBuissonOReilly commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

The vue-router.js file has the following code on line 17: const {getByTestId} = render(App, {routes})

When I use the syntax render(xxx, {routes}) in my project, I get the following warning: Providing 'store' or 'routes' options is no longer available. You need to create a router/vuex instance and provide it through 'global.plugins'. Check out the test examples on GitHub for further details.

However, the test examples in the vue-router.js file do not show the 'global.plugins' approach.

This is my first bug report, I hope it's helpful!

afontcu commented 3 years ago

Hi, and thank you for your first report! It seems that you're using Vue Testing Library for Vue 3 (which lives in next), but checking docs for Vue 2 (which lives in main).

Here's the router example file for Vue 3: https://github.com/testing-library/vue-testing-library/blob/next/src/__tests__/vue-router.js

hope it helps!

FlorentBuissonOReilly commented 3 years ago

Duh! Yes, you're correct. Thanks for taking the time to let me know!