2
0
Эх сурвалжийг харах

test(runtime-vapor): globalProperty (#255)

Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
GaoNeng 1 жил өмнө
parent
commit
d14c5d93d2

+ 12 - 0
packages/runtime-vapor/__tests__/apiCreateVaporApp.spec.ts

@@ -332,4 +332,16 @@ describe('api: createVaporApp', () => {
       expect(window.performance.getEntries()).lengthOf(0)
     })
   })
+
+  test('config.globalProperty', () => {
+    const { app, mount, html } = define({
+      render() {
+        const instance = getCurrentInstance()!
+        return createTextNode([instance.appContext.config.globalProperties.msg])
+      },
+    }).create()
+    app.config.globalProperties.msg = 'hello world'
+    mount()
+    expect(html()).toBe('hello world')
+  })
 })