effectify Bus service: migrate to Effect PubSub + InstanceState (#18579)

This commit is contained in:
Kit Langton 2026-03-25 20:19:24 -04:00 committed by GitHub
commit 97c15a087d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 1120 additions and 529 deletions

View file

@ -110,10 +110,16 @@ describe("SyncEvent", () => {
type: string
properties: { id: string; name: string }
}> = []
const unsub = Bus.subscribeAll((event) => events.push(event))
const received = new Promise<void>((resolve) => {
Bus.subscribeAll((event) => {
events.push(event)
resolve()
})
})
SyncEvent.run(Created, { id: "evt_1", name: "test" })
await received
expect(events).toHaveLength(1)
expect(events[0]).toEqual({
type: "item.created",
@ -122,8 +128,6 @@ describe("SyncEvent", () => {
name: "test",
},
})
unsub()
}),
)
})