mock-vue-router
A mock vue-router to aid unit testing
Install
npm install mock-vue-router --save-dev
Create
;const $router $route = ;
Create with routes
;const $router $route = ;
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