mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-12 16:42:26 +03:00
test: prevent plugin install twice
This commit is contained in:
@@ -63,6 +63,18 @@ describe('plugin', () => {
|
||||
expect(VueMetaServerPlugin.version).toBe('test-version')
|
||||
})
|
||||
|
||||
test('plugin isnt be installed twice', () => {
|
||||
expect(Vue.__vuemeta_installed).toBe(true)
|
||||
|
||||
Vue.prototype.$meta = undefined
|
||||
Vue.use({ ...VueMetaServerPlugin })
|
||||
|
||||
expect(Vue.prototype.$meta).toBeUndefined()
|
||||
|
||||
// reset Vue
|
||||
Vue = loadVueMetaPlugin(true)
|
||||
})
|
||||
|
||||
test('prints deprecation warning once when using _hasMetaInfo', () => {
|
||||
const warn = jest.spyOn(console, 'warn').mockImplementation(() => {})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user