Skip to content

Commit d84d5ec

Browse files
authored
test(vue): add config.compilerOptions.isCustomElement test (#4682)
1 parent 3f5f98d commit d84d5ec

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/vue/__tests__/index.spec.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe('compiler + runtime integration', () => {
131131
).toHaveBeenWarned()
132132
})
133133

134-
it('should support custom element', () => {
134+
it('should support custom element via config.isCustomElement (deprecated)', () => {
135135
const app = createApp({
136136
template: '<custom></custom>'
137137
})
@@ -141,6 +141,16 @@ describe('compiler + runtime integration', () => {
141141
expect(container.innerHTML).toBe('<custom></custom>')
142142
})
143143

144+
it('should support custom element via config.compilerOptions.isCustomElement', () => {
145+
const app = createApp({
146+
template: '<custom></custom>'
147+
})
148+
const container = document.createElement('div')
149+
app.config.compilerOptions.isCustomElement = tag => tag === 'custom'
150+
app.mount(container)
151+
expect(container.innerHTML).toBe('<custom></custom>')
152+
})
153+
144154
it('should support using element innerHTML as template', () => {
145155
const app = createApp({
146156
data: () => ({

0 commit comments

Comments
 (0)