Skip to content

Commit 7c72983

Browse files
committed
Add testUrl to avoid jsdom SecurityError
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.
1 parent 33ededc commit 7c72983

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"vue-template-compiler": "^2.5.13"
3838
},
3939
"jest": {
40+
"testURL": "http://localhost/",
4041
"moduleFileExtensions": [
4142
"js",
4243
"vue"

test/PictureInput.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { shallow } from '@vue/test-utils'
1+
import { shallowMount } from '@vue/test-utils'
22
import { createRenderer } from 'vue-server-renderer'
33

44
import PictureInput from '../PictureInput.vue'
55

66
describe('PictureInput.vue', () => {
77
it('matches snapshot', () => {
88
const renderer = createRenderer()
9-
const wrapper = shallow(PictureInput)
9+
const wrapper = shallowMount(PictureInput)
1010
renderer.renderToString(wrapper.vm, (err, str) => {
1111
if (err) throw new Error(err)
1212
expect(str).toMatchSnapshot()

0 commit comments

Comments
 (0)