testing/connection_closer_helpers.ts

view source

Declarations
#

4 declarations

assert_close_call
#

testing/connection_closer_helpers.ts view source

(call: RecordedClose | undefined, expected: RecordedClose): void import {assert_close_call} from '@fuzdev/fuz_app/testing/connection_closer_helpers.js';

Pin a single recorded close call to expected (deep equality).

Throws via assert.ok if call is undefined — index a recorded calls array directly (calls[0]) and let this helper handle the missing-element case.

call

type RecordedClose | undefined

expected

returns

void

create_recording_closer
#

testing/connection_closer_helpers.ts view source

(): RecordingCloser import {create_recording_closer} from '@fuzdev/fuz_app/testing/connection_closer_helpers.js';

Build a ConnectionCloser that records every call into calls rather than touching real transports. Each method returns 1 ("one connection closed") regardless of whether a real connection exists — handlers ignore the return value.

To see a handler's closes, add the closer to the backend's deps.connection_closer (RealtimeCloser.add), or build the action factory's deps with it.

returns

RecordingCloser

RecordedClose
#

RecordingCloser
#

Depends on
#