Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export type CircuitWebWorker = {
renderUntilSettled: () => Promise<void>
getCircuitJson: () => Promise<AnyCircuitElement[]>
on: (event: RootCircuitEventName, callback: (...args: any[]) => void) => void
clearEventListeners: () => void
clearEventListeners: () => Promise<void>
enableDebug: (namespace: string) => Promise<void>
version: () => Promise<string>
kill: () => Promise<void>
Expand Down
9 changes: 4 additions & 5 deletions tests/examples/example05-event-recording.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { test, expect } from "bun:test"
import { createCircuitWebWorker } from "lib/index"

// Skipped for flakiness, re-enable when flakiness is solved
test.skip("example5-event-recording", async () => {
test("example5-event-recording", async () => {
const circuitWebWorker = await createCircuitWebWorker({
webWorkerUrl: new URL("../../webworker/entrypoint.ts", import.meta.url),
})
Expand All @@ -22,11 +21,11 @@ test.skip("example5-event-recording", async () => {

await circuitWebWorker.renderUntilSettled()

// Clear event listeners
await circuitWebWorker.clearEventListeners()
expect(eventCount).toBeGreaterThan(0)
const initialEventCount = eventCount

// Clear event listeners
circuitWebWorker.clearEventListeners()
const initialEventCount = eventCount

// Add another component to trigger more events
await circuitWebWorker.execute(`
Expand Down