avoriaz Build Status

a Vue.js testing utility library

Installation

npm install --save-dev avoriaz

Docs

Visit the docs

Examples

Call DOM events on the Vue wrapper
import { mount } from 'avoriaz';
import Foo from './Foo.vue';

const wrapper = mount(Foo, {
  propsData: { clickHandler },
});

wrapper.simulate('click');
Assert wrapper contains a child
import { mount } from 'avoriaz';
import Foo from './Foo.vue';

const wrapper = mount(Foo);

expect(wrapper.contains('.bar')).to.equal(true);
Assert wrapper contains text
import { mount } from 'avoriaz';
import Foo from './Foo.vue';

const wrapper = mount(Foo);
const button = wrapper.find('div > button')[0];

expect(wrapper.text()).to.equal('some text');
Call DOM events on a child
import { mount } from 'avoriaz';
import Foo from './Foo.vue';

clickHandler = sinon.stub();

const wrapper = mount(Foo, {
  propsData: { clickHandler },
});

const bar = wrapper.find('div .bar')[0];

bar.simulate('click');

expect(clickHandler.called()).to.equal(true)

Related Repositories

avoriaz

avoriaz

a Vue.js testing utility library ...

avoriaz-jest-example

avoriaz-jest-example

Example project using avoriaz and jest ...

avoriaz-karma-mocha-example

avoriaz-karma-mocha-example

Example using avoriaz with karma and mocha to test Vue.js components ...

avoriaz-mocha-example

avoriaz-mocha-example

Example using avoriaz with mocha-webpack to test Vue.js components ...