chore: fix vapor apiExpose test

This commit is contained in:
Evan You 2024-12-10 21:39:09 +08:00
parent dff54a17fb
commit b191beb876
No known key found for this signature in database
GPG Key ID: 00E9AB7A6704CE0A
1 changed files with 5 additions and 4 deletions

View File

@ -54,16 +54,17 @@ describe('api: expose', () => {
})
test('with mount', () => {
const { instance } = define({
const { app, host } = define({
setup(_, { expose }) {
expose({
foo: 1,
})
return []
},
}).render()
expect(instance!.foo).toBe(1)
expect(instance!.bar).toBe(undefined)
}).create()
const exposed = app.mount(host) as any
expect(exposed.foo).toBe(1)
expect(exposed.bar).toBe(undefined)
})
test('warning for ref', () => {