Skip to content

Commit 0e80f99

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

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Vue from 'vue'
22
import Vuex from 'vuex'
33
import VueRouter from 'vue-router'
44
import { createLocalVue } from 'packages/test-utils/src'
5+
import { mount } from 'packages/test-utils/src'
56
import Component from '~resources/components/component.vue'
67
import ComponentWithVuex from '~resources/components/component-with-vuex.vue'
78
import ComponentWithRouter from '~resources/components/component-with-router.vue'
@@ -232,3 +233,32 @@ describeWithShallowAndMount('createLocalVue', mountingMethod => {
232233
}
233234
)
234235
})
236+
237+
// TODO: Clean this up, it's only useful while debugging the issue.
238+
describe.only('Test', () => {
239+
// When setting the array length value to `1`, then the issue disappears.
240+
// However, when setting it to anything bigger, the issue appears.
241+
const sets = Array.from({ length: 2 })
242+
243+
it.each(sets)(
244+
// Note, the message may not be the final one, based on what I discover.
245+
'Does not exceed maximum call stack size when no custom error handler is defined',
246+
() => {
247+
const { error } = global.console
248+
const spy = jest.spyOn(global.console, 'error')
249+
const localVue = createLocalVue()
250+
251+
try {
252+
// TODO: Replace with mountingMethod.
253+
mount(ComponentWithSyncError, { localVue })
254+
} catch {
255+
const expected = expect.stringMatching(
256+
/Maximum call stack size exceeded/
257+
)
258+
259+
global.console.error = error
260+
expect(spy).not.toHaveBeenCalledWith(expected)
261+
}
262+
}
263+
)
264+
})

0 commit comments

Comments
 (0)