Skip to content

Commit

Permalink
test(vue): add config.compilerOptions.isCustomElement test (#4682)
Browse files Browse the repository at this point in the history
  • Loading branch information
caozhong1996 committed Sep 27, 2021
1 parent 3f5f98d commit d84d5ec
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/vue/__tests__/index.spec.ts
Expand Up @@ -131,7 +131,7 @@ describe('compiler + runtime integration', () => {
).toHaveBeenWarned()
})

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

it('should support custom element via config.compilerOptions.isCustomElement', () => {
const app = createApp({
template: '<custom></custom>'
})
const container = document.createElement('div')
app.config.compilerOptions.isCustomElement = tag => tag === 'custom'
app.mount(container)
expect(container.innerHTML).toBe('<custom></custom>')
})

it('should support using element innerHTML as template', () => {
const app = createApp({
data: () => ({
Expand Down

0 comments on commit d84d5ec

Please sign in to comment.