Skip to content

Commit 6fe2eb9

Browse files
committed
feat: test duplicate plugins, mock global.console
1 parent 8d5ac27 commit 6fe2eb9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

tests/unit/VueFinalModal.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,5 +397,14 @@ describe('VueFinalModal.vue', () => {
397397
})
398398
done()
399399
})
400+
it('Register duplicate plugins', async done => {
401+
global.console = { error: jest.fn() }
402+
const spy = jest.spyOn(global.console, 'error')
403+
const localVue = createLocalVue()
404+
localVue.use(VueFinalModal())
405+
localVue.use(VueFinalModal())
406+
expect(spy).toHaveBeenCalledTimes(3)
407+
done()
408+
})
400409
})
401410
})

tests/unit/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createLocalVue, mount } from '@vue/test-utils'
22
import VueFinalModal from '../../lib'
33

4-
export function afterTransition(callback, transitionDelay = 300) {
4+
export function afterTransition(callback, transitionDelay = 60) {
55
setTimeout(() => {
66
callback()
77
}, transitionDelay)

0 commit comments

Comments
 (0)