/** * Tiny, dependency-free test helpers for driving serial devices — shared by the * library's own conformance suite, the {@link SerialClient}, and consumers' app * tests. Free of `jest` and `react-native`, so they run under any test runner * and on a real device (e.g. an on-device Self-Test screen). */ /** Throw `message` if `condition` is falsy. */ export declare function assert(condition: unknown, message: string): asserts condition; /** Throw if `actual !== expected`, including both values in the message. */ export declare function assertEqual(actual: T, expected: T, message: string): void; /** Byte-for-byte equality of two sequences. */ export declare function bytesEqual(a: ArrayLike, b: ArrayLike): boolean; /** What {@link assertRejects} may additionally check about the thrown error. */ export type RejectionExpectation = { name?: string; type?: new (...args: never[]) => Error; message?: string | RegExp; }; /** Assert `fn()` rejects (optionally matching the error name/type/message). */ export declare function assertRejects(fn: () => Promise, message: string, expected?: RejectionExpectation): Promise; /** Normalise any thrown value into a `"Name: message"` string. */ export declare function errorMessage(e: unknown): string; /** Reject if `promise` doesn't settle within `ms`; `label` names it on timeout. */ export declare function withTimeout(promise: Promise, ms: number, label: string): Promise; /** The slice of `ReadableStreamDefaultReader` the helpers need. */ export type ByteReader = { read(): Promise<{ done: boolean; value?: Uint8Array; }>; }; /** Read exactly `count` bytes from a reader (accumulating chunks), with a timeout. */ export declare function readBytes(reader: ByteReader, count: number, timeoutMs?: number): Promise; //# sourceMappingURL=harness.d.ts.map