mock-vue-router
A mock vue router to aid unit testing
9,137
5
| Install | |
|---|---|
npm install mock-vue-router |
|
| Latest Version: | 0.1.3 |
| Vue: | 2 |
| License: | MIT |
| Last Updated: | Jul 3, 2017 |
| Links: | GitHub · npm |
Maintainer: jackmellis
mock-vue-router
A mock vue-router to aid unit testing
Install
npm install mock-vue-router --save-dev
Create
import mock from 'mock-vue-router';
const {$router, $route} = mock();
Create with routes
import mock from 'mock-vue-router';
const {$router, $route} = mock(['/', '/users', '/users/:userId']);
mock-vue-router mimics all standard behaviour of vue-router, such as $router.push, $router.replace, and navigation variants. The corresponding $route object will update to reflect the current path, params, query, and hash.
Full Documentation:
https://jackmellis.gitbooks.io/vuenit/content/router/introduction.html
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.1.3 | ^2.3.3 | MIT | |
| 0.1.2 | ^2.3.3 | MIT | |
| 0.1.1 | ^2.3.3 | MIT | |
| 0.1.0 | ^2.3.3 | MIT |