Package-level declarations

Types

Link copied to clipboard

Thrown by the assert* functions in this file on a failed assertion.

Link copied to clipboard

A Transport that records every event in memory instead of sending it anywhere — for unit tests that need to assert "does this code fire the right event with the right properties?" without a real backend or dev.ynagai.autograph.DebugTransport's log-only, non-assertable output.

Functions

Link copied to clipboard

Asserts that a track event named name was recorded, and returns it.

Link copied to clipboard

Asserts that no track event named name was ever recorded.

Link copied to clipboard

Asserts that identify(userId, ...) was recorded, and returns it. See assertEventFired for traits/exact.

Link copied to clipboard

Asserts that both dev.ynagai.autograph.Envelope.seq (gapless, +1 within each contiguous run of events sharing a session id — a session rotation restarts it at 1, which is expected and not a gap) and dev.ynagai.autograph.Envelope.globalSeq (gapless, +1 across the whole device lifetime, independent of session) hold wherever each is non-null. Depending on AutographConfig.sequence, only one, both, or neither may be stamped (SequenceMode.None stamps neither, so nothing is checked); events with no envelope are skipped.

Link copied to clipboard

Asserts that events fired in exactly this names order (across all kinds — track/screen/identify).

Link copied to clipboard

Asserts that a screen event named name was recorded, and returns it. See assertEventFired for properties/exact.

Link copied to clipboard

Asserts every recorded event with an envelope belongs to the same session (no rotation occurred), and returns that session id.

Link copied to clipboard
fun testEnvelope(eventId: String = "test-event-id", sessionId: String = "test-session", sessionStartEpochMillis: Long = 0, seq: Long? = null, globalSeq: Long? = null, sdk: String = "autograph/test", eventTimestamp: String = "2026-01-01T00:00:00.000Z", schemaVersion: String? = null): Envelope

Builds an Envelope with exactly the field values you ask for, for tests that need to assert on a known envelope rather than whatever a real tracker happens to stamp.