Skip to content

Commit f2c8a90

Browse files
author
boquanfu
committed
test: add test cases for #63
1 parent 972b20f commit f2c8a90

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/index.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ test('component with store constructor (multiple stores)', async () => {
405405
const component = renderComponent(undefined, '<view>{{sum}}</view><view>{{s}}</view>', (Component) => {
406406
;(globalThis as any).Component = Component
407407
ComponentWithStore({
408+
data: {},
408409
storeBindings: [
409410
{
410411
store: store1,
@@ -421,6 +422,10 @@ test('component with store constructor (multiple stores)', async () => {
421422
this.update(1)
422423
this.up(2)
423424
},
425+
attached() {
426+
expect(this.data.sum).toBe(5)
427+
expect(this.data.s).toBe(8)
428+
},
424429
})
425430
;(globalThis as any).Component = undefined
426431
}) as any

0 commit comments

Comments
 (0)