vuenit
Vue Unit Test Helpers for server-side testing
1,793
35
| Install | |
|---|---|
npm install vuenit |
|
| Latest Version: | 1.2.0 |
| Vue: | 2 |
| License: | ISC |
| Last Updated: | Apr 16, 2019 |
| Links: | GitHub · npm |
Maintainer: jackmellis
vuenit
Vue Unit Test Helpers
Vuenit is a testing utility that offers a number of useful methods to make testing Vue applications easier:
- Easily mount Vue components
- Test directives
- Search the DOM for component instances
- Inject dependencies into components
- Test slots
- Update data and props on the fly
- Shallow rendering
- Mocked versions of Vuex, Vue-Router, and a $http module to make testing with dependencies easier
npm install vuenit --save-dev
import {mount, mockRouter, mockHttp, mockStore} from 'vuenit';
import c from 'path/to/component';
const {$router} = mockRouter();
const $http = mockHttp();
const $store = mockStore();
const options = {
inject : { $router, $http, $store },
props : { userId : 'x4' },
stubComponents : true
};
const vm = mount(c, options);
Vuenit has a huge array of configuration options for different testing scenarios. For full documentation, see https://jackmellis.gitbooks.io/vuenit/content
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.2.0 | ^2.0.0 | ISC | |
| 1.1.2 | 2.0.0 | ISC | |
| 1.1.1 | 2.x | ISC | |
| 1.1.0 | 2.x | ISC | |
| 1.0.0 | 2.x | ISC | |
| 0.6.1 | 2.x | ISC | |
| 0.6.0 | 2.x | ISC | |
| 0.5.0 | 2.x | ISC | |
| 0.4.2 | 2.x | ISC | |
| 0.4.1 | 2.x | ISC | |
| 0.4.0 | 2.x | ISC | |
| 0.3.1 | 2.x | ISC | |
| 0.3.0 | 2.x | ISC | |
| 0.2.0 | 2.x | ISC | |
| 0.1.0 | 2.x | ISC |