Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
fix: vue-router with jsdom (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarols authored Jul 24, 2023
1 parent b5fdf2d commit 4ebb670
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vitest-environment-nuxt/src/env/jsdom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export default <EnvironmentNuxt> async function (global, { jsdom = {} }) {
},
).window as any

// Vue-router relies on scrollTo being available if run in a browser.
// The scrollTo implementation from JSDOM throws a "Not Implemented" error
window.scrollTo = () => {}

return {
window,
teardown() {}
Expand Down

0 comments on commit 4ebb670

Please sign in to comment.