wip: make singleton mutations affect all app instances

This commit is contained in:
Evan You
2021-05-05 17:56:09 -04:00
parent 61edb700d7
commit f2a5a3ee55
5 changed files with 107 additions and 56 deletions

View File

@@ -1,5 +1,6 @@
import Vue from '@vue/compat'
import { toggleDeprecationWarning } from '../../runtime-core/src/compat/compatConfig'
import { createApp } from '../src/esm-index'
import { triggerEvent } from './utils'
beforeEach(() => {
@@ -64,3 +65,12 @@ test('GLOBAL_IGNORED_ELEMENTS', () => {
})
expect(el.innerHTML).toBe(`<v-foo></v-foo><foo></foo>`)
})
test('singleton config should affect apps created with createApp()', () => {
Vue.config.ignoredElements = [/^v-/, 'foo']
const el = document.createElement('div')
createApp({
template: `<v-foo/><foo/>`
}).mount(el)
expect(el.innerHTML).toBe(`<v-foo></v-foo><foo></foo>`)
})