• Stars
    star
    761
  • Rank 59,698 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 8 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ”¬ a Vue.js testing utility library

avoriaz Build Status

a Vue.js testing utility library

Deprecation

This library will be deprecated once vue-test-utils is released.

Installation

npm install --save-dev avoriaz

Documentation

Visit the docs

Examples

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)
Shallow render components
import { shallow } from 'avoriaz'
import Foo from './Foo.vue'
import Bar from './Bar.vue'

const wrapper = shallow(Foo)
expect(wrapper.contains(Bar)).to.equal(true)
Assert style is rendered
const button = wrapper.find('div > button .button-child')[0]
expect(button.hasStyle('color', 'red')).to.equal(true)
Assert method is called when DOM event is triggered
const clickHandler = sinon.stub()
const wrapper = mount(Foo, {
  propsData: { clickHandler }
})
wrapper.find('div .bar')[0].trigger('click')
expect(clickHandler.called).to.equal(true)
Assert wrapper contains text
const title = wrapper.find('h1.title')[0]
expect(title.text()).to.equal('some text')
Inject globals
const $route = { path: 'http://www.example-path.com' }
const wrapper = mount(Foo, { 
    globals: {
        $route
    }
})
expect(wrapper.vm.$route.path).to.equal($route.path)
Inject slots
const wrapper = mount(Foo, { 
    slots: {
        default: Foo
    }
})
Set data
wrapper.setData({
  someData: 'some data'
})

expect(wrapper.vm.someData).to.equal('some data')
Update props
wrapper.setProps({
  someProp: 'some prop',
  anotherProp: 'another prop'
})

For more examples, see the docs

More Repositories

1

vue-hackernews

A Vue hacker news application with tests
JavaScript
157
star
2

vue-test-loader

Extract custom test blocks from Vue components
JavaScript
131
star
3

simple-redux

A bare-bones redux implementation for teaching purposes πŸŽ“
JavaScript
114
star
4

jest-transform-stub

Jest stub transform
JavaScript
113
star
5

vue-test-utils-jest-example

An example vue-test-utils project with jest
JavaScript
91
star
6

vue-unit-test-perf-comparison

Comparison of Vue SFC unit tests using different test runners
JavaScript
64
star
7

parcel-vuejs-template

Parcel template for Vue CLI
JavaScript
63
star
8

jest-serializer-vue

Jest Serializer for Vue components
JavaScript
62
star
9

notes

Notes on computer science https://notes.eddyerburgh.me/ πŸ“š
TeX
59
star
10

vue-test-utils-vuex-example

Example repository testing vuex with vue-test-utils
JavaScript
52
star
11

testing-vuex-store-example

Testing a Vuex store
JavaScript
48
star
12

example-front-end-test-pyramid-app

An example app demonstrating the front-end pyramid
JavaScript
41
star
13

vue-digital-clock

πŸ•š Simple digital clock built with Vue.js
JavaScript
41
star
14

vue-test-utils-ava-example

An example vue-test-utils project with AVA
JavaScript
30
star
15

mock-vuex-in-vue-unit-tests-tutorial

Example repo demonstrating how to mock Vuex in Vue unit tests
JavaScript
29
star
16

vue-test-utils-karma-example

JavaScript
26
star
17

data-structures-in-practice

Learn about data structures and how they are used in open source projects. https://data-structures-in-practice.com/
SCSS
22
star
18

react-boilerplate

πŸš€ Quickly start a react project with this boilerplate
JavaScript
18
star
19

how-to-unit-test-vue-components-for-beginners

Repo for tutorial on how to test vue components
JavaScript
16
star
20

avoriaz-ava-example

Testing Vue components with AVA and avoriaz example
JavaScript
16
star
21

git-init-plus

⚑ Turbo charged git init
Shell
15
star
22

avoriaz-karma-mocha-example

Example using avoriaz with karma and mocha to test Vue.js components
JavaScript
13
star
23

avoriaz-jest-example

Example project using avoriaz and jest
JavaScript
12
star
24

vue-email-signup-form-app

Demonstration repo
JavaScript
12
star
25

avoriaz-mocha-example

Example using avoriaz with mocha-webpack to test Vue.js components
JavaScript
12
star
26

testing-a-vuex-store-example-app

Example app for testing Vuex
JavaScript
10
star
27

vue-test-utils-tape-example

An example vue-test-utils project with tape
JavaScript
8
star
28

tape-vue-example

JavaScript
8
star
29

vue-jest-example

Example project using Jest
JavaScript
7
star
30

vue-test-loader-example

An example project using vue-test-loader to extract tests
Vue
7
star
31

react-dev-tools-iframe-webpack-plugin

Inject code to set up React dev tools for code running in an iframe
JavaScript
6
star
32

vue-unit-test-starter

Starter project for Vue unit testing tutorials
JavaScript
6
star
33

dom-event-types

DOM event data scraped from MDN
TypeScript
5
star
34

vue-test-utils-mocha-example

An example vue-test-utils project with mocha
JavaScript
5
star
35

conditional-specs

Conditional spec methods for test suites that run in multiple environments
JavaScript
4
star
36

palette-generator

🎨 Webapp that generates color palettes. Built with Vue + Vuex
JavaScript
4
star
37

vue-add-globals

Add globals to a Vue instance 🌎
JavaScript
4
star
38

vue-amsterdam-example

Example from Vue Amsterdam talkβ€”slides.com/eddyerburgh/testing-vue-components
JavaScript
4
star
39

blog

πŸ“• My personal blog
SCSS
3
star
40

vue-test-utils-proposal

Proposed API for vue test utils
3
star
41

stub-route-in-vue-unit-tests

A demonstration of how to stub $route in Vue unit tests
JavaScript
3
star
42

avoriaz-karma-jasmine-example

Simple avoriaz example using karma and jasmine
JavaScript
3
star
43

jest-vue-example

Finished project of Vue Jest
JavaScript
2
star
44

express-mongo-rest-api-boilerplate

An express REST API boilerplate with mongo and mongoose. Dockerized
JavaScript
2
star
45

stub-vue-components-inject-loader

JavaScript
1
star
46

codemods

JavaScript
1
star
47

is-dom-selector

JavaScript function to validate a DOM selector
JavaScript
1
star
48

vue-ios-calculator

Vue IOS calculator app
Vue
1
star
49

palette-picker

A web app that lets you store and copy swatches of color. Built with react + redux
JavaScript
1
star