Vue-test-utils: Avoriaz migration

Created on 12 Oct 2017  ·  9Comments  ·  Source: vuejs/vue-test-utils

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?

intend to implement

Most helpful comment

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 🙂

All 9 comments

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.

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

@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.

@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.

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 |

@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.

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 🙂

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 :)

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ParsonsProjects picture ParsonsProjects  ·  3Comments

AustinGil picture AustinGil  ·  3Comments

38elements picture 38elements  ·  3Comments

matt-sanders picture matt-sanders  ·  3Comments

jonyoder picture jonyoder  ·  3Comments