From d84d5ecdbdf709570122175d6565bb61fae877f2 Mon Sep 17 00:00:00 2001
From: Che Guevara <836934184@qq.com>
Date: Mon, 27 Sep 2021 22:52:59 +0800
Subject: [PATCH] test(vue): add config.compilerOptions.isCustomElement test
(#4682)
---
packages/vue/__tests__/index.spec.ts | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/packages/vue/__tests__/index.spec.ts b/packages/vue/__tests__/index.spec.ts
index 99e3a63a..a51c7fd9 100644
--- a/packages/vue/__tests__/index.spec.ts
+++ b/packages/vue/__tests__/index.spec.ts
@@ -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: ''
})
@@ -141,6 +141,16 @@ describe('compiler + runtime integration', () => {
expect(container.innerHTML).toBe('')
})
+ it('should support custom element via config.compilerOptions.isCustomElement', () => {
+ const app = createApp({
+ template: ''
+ })
+ const container = document.createElement('div')
+ app.config.compilerOptions.isCustomElement = tag => tag === 'custom'
+ app.mount(container)
+ expect(container.innerHTML).toBe('')
+ })
+
it('should support using element innerHTML as template', () => {
const app = createApp({
data: () => ({