Skip to content

Commit be6a882

Browse files
committed
test(create-local-vue): add a failing test
1 parent cfee9b5 commit be6a882

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/specs/create-local-vue.spec.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,4 +231,27 @@ describeWithShallowAndMount('createLocalVue', mountingMethod => {
231231
}
232232
}
233233
)
234+
235+
// This test is related to the issue 1768.
236+
// See: https://github.com/vuejs/vue-test-utils/issues/1768
237+
itSkipIf(
238+
process.env.TEST_ENV === 'browser' || vueVersion < 2.6,
239+
'Does not exceed maximum call stack size when no custom error handler is defined',
240+
async () => {
241+
const { error } = global.console
242+
const spy = jest.spyOn(global.console, 'error')
243+
const localVue = createLocalVue()
244+
245+
try {
246+
mountingMethod(ComponentWithSyncError, { localVue })
247+
} catch {
248+
const expected = expect.stringMatching(
249+
/Maximum call stack size exceeded/
250+
)
251+
252+
global.console.error = error
253+
expect(spy).not.toHaveBeenCalledWith(expected)
254+
}
255+
}
256+
)
234257
})

0 commit comments

Comments
 (0)