Skip to content

Commit

Permalink
Add testUrl to avoid jsdom SecurityError
Browse files Browse the repository at this point in the history
Without testUrl
"SecurityError: localStorage is not available for opaque origins"
errors happens with latest jsdom.
Refer jsdom/jsdom#2304 to more detail information.

Also shallow deprecation has been resolved.
  • Loading branch information
farin committed Aug 26, 2018
1 parent 33ededc commit 7c72983
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"vue-template-compiler": "^2.5.13"
},
"jest": {
"testURL": "http://localhost/",
"moduleFileExtensions": [
"js",
"vue"
Expand Down
4 changes: 2 additions & 2 deletions test/PictureInput.spec.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { shallow } from '@vue/test-utils'
import { shallowMount } from '@vue/test-utils'
import { createRenderer } from 'vue-server-renderer'

import PictureInput from '../PictureInput.vue'

describe('PictureInput.vue', () => {
it('matches snapshot', () => {
const renderer = createRenderer()
const wrapper = shallow(PictureInput)
const wrapper = shallowMount(PictureInput)
renderer.renderToString(wrapper.vm, (err, str) => {
if (err) throw new Error(err)
expect(str).toMatchSnapshot()
Expand Down

0 comments on commit 7c72983

Please sign in to comment.