Skip to content

Commit

Permalink
fix(mocha): fix vue-router creation using mocha (#128)
Browse files Browse the repository at this point in the history
* fix(#119): allow routes vue-router creation through routes param from both jest and mocha

* add test to check vue-router require for mocha users

* fix Vue Router require to be compatible with CommonJS

* delete deprecated test
  • Loading branch information
agualis committed Mar 18, 2020
1 parent 58a4b5a commit d628f36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vue-testing-library.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ function render(
}

if (routes) {
const VueRouter = require('vue-router') || require('vue-router').default
const requiredRouter = require('vue-router')
const VueRouter = requiredRouter.default || requiredRouter
localVue.use(VueRouter)
router = new VueRouter({
routes,
Expand Down

0 comments on commit d628f36

Please sign in to comment.