Skip to content
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

Avoriaz migration #89

Closed
rssfrncs opened this issue Oct 12, 2017 · 9 comments
Closed

Avoriaz migration #89

rssfrncs opened this issue Oct 12, 2017 · 9 comments

Comments

@rssfrncs
Copy link
Contributor

First, am i correct in assuming Avoriaz development will stop?

If so, do you plan on offering any sort of migration guide or tool to help Avoriaz users move to vue-test-utils?

@eddyerburgh
Copy link
Member

eddyerburgh commented Oct 12, 2017

I won't stop developing maintaining avoriaz, but my focus is on vue-test-utils.

Adding a migration guide is on my todo list, but it's pretty low down. I'm not sure when I'll get around to it.

If a lot of people would find one useful I'll raise the priority of it.

@wparad
Copy link

wparad commented Oct 12, 2017

Doesn't have to be fancy, just some quick tips, even posting in this thread would be helpful.

@rssfrncs
Copy link
Contributor Author

rssfrncs commented Oct 12, 2017

@eddyerburgh Curious as to your decision to keep Avoriaz going? Won't it be confusing for developers to have two extremely similar testing libraries?

You often see in "Vue vs X framework" discussions, that developers opting for Vue, enjoy not having to make as many decisions around libraries as there are official offerings: vue-router, vuex and soon vue-test-utils.

@eddyerburgh
Copy link
Member

eddyerburgh commented Oct 12, 2017

@rssfrncs I don't want people who built projects using avoriaz to be stuck.

Developing was probably the wrong word. I'll keep maintaining avoriaz — in other words, fixing bugs.

I understand your concern. I think that once vue-test-utils is officially released, avoriaz will fade away. Maybe I'm wrong, and I should deprecate it once vue-test-utils is fixed.

@eddyerburgh
Copy link
Member

eddyerburgh commented Oct 12, 2017

Moving from avoriaz to vue-test-utils

The main difference between avoriaz and vue-test-utils is the find API.

In avoriaz there is one method to traverse the render tree—find. find returns an array of wrappers that match the selector.

// avoriaz
const wrapper = mount(Component)
wrapper.find('div')[0].is('div')

In vue-test-utils, there are two methods to traverse the render tree—find and findAll. find returns the first wrapper matching the selector, findAll returns an array-like object.

// vue-test-utils
const wrapper = mount(Component)
wrapper.find('div').is('div')
wrapper.findAll('div').at(0).is('div')

Another difference is the name of the mount options:

avoriaz vue-test-utils
globals mocks
'instance localVue

@rssfrncs
Copy link
Contributor Author

rssfrncs commented Oct 12, 2017

@eddyerburgh Honestly, I think it that pushing devs over to vue-test-utils would be the best thing to do.

As someone who is working on a project with over 100 test cases using Avoriaz, I was slightly concerned to see vue-test-utils announced with you, the creator of Avoriaz, developing it. However, comparing the APIs, it seems like a relatively harmless migration and extremely worth it to be adopting an "official" library.

@eddyerburgh
Copy link
Member

Ok, I've thought more about it, and I agree.

I'll add a deprecation notice and a migration guide to avoriaz when vue-test-utils is released 🙂

@callumacrae
Copy link
Contributor

I'll add a deprecation notice and a migration guide to avoriaz when vue-test-utils is released 🙂

This was my plan for vue-test too :)

@eddyerburgh
Copy link
Member

I've added a migration guide page to the avoriaz docs — https://eddyerburgh.gitbooks.io/avoriaz/content/guides/migrating-to-vue-test-utils.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants