From e63ca03bc9514c26c5b94c2010bf73f11fc19319 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 8 May 2026 21:05:27 +0100 Subject: [PATCH] test: tighten pairing provider assertions --- extensions/matrix/src/matrix/sdk.test.ts | 4 +++- extensions/twitch/src/setup-surface.test.ts | 6 ++++-- src/pairing/pairing-store.test.ts | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/extensions/matrix/src/matrix/sdk.test.ts b/extensions/matrix/src/matrix/sdk.test.ts index 01e088972a4..69d0a0a5be2 100644 --- a/extensions/matrix/src/matrix/sdk.test.ts +++ b/extensions/matrix/src/matrix/sdk.test.ts @@ -3213,7 +3213,9 @@ describe("MatrixClient crypto bootstrapping", () => { expect(result.success).toBe(true); expect(result.verification.verified).toBe(true); expect(result.crossSigning.published).toBe(true); - expect(result.cryptoBootstrap).not.toBeNull(); + if (!result.cryptoBootstrap) { + throw new Error("expected Matrix crypto bootstrap result"); + } }); it("reports bootstrap failure when the device is only locally trusted", async () => { diff --git a/extensions/twitch/src/setup-surface.test.ts b/extensions/twitch/src/setup-surface.test.ts index c1cc263ae22..4b102f3f97f 100644 --- a/extensions/twitch/src/setup-surface.test.ts +++ b/extensions/twitch/src/setup-surface.test.ts @@ -200,8 +200,10 @@ describe("setup surface helpers", () => { ); // Should return config with username and clientId - expect(result).not.toBeNull(); - const defaultAccount = result?.cfg.channels?.twitch?.accounts?.default as + if (!result) { + throw new Error("expected Twitch env-token setup result"); + } + const defaultAccount = result.cfg.channels?.twitch?.accounts?.default as | { username?: string; clientId?: string } | undefined; expect(defaultAccount?.username).toBe("testbot"); diff --git a/src/pairing/pairing-store.test.ts b/src/pairing/pairing-store.test.ts index 5b1214303d8..2f47c756df4 100644 --- a/src/pairing/pairing-store.test.ts +++ b/src/pairing/pairing-store.test.ts @@ -83,7 +83,6 @@ function requireFirstPairingRequest( ) { expect(requests).toHaveLength(1); const [request] = requests; - expect(request).toBeDefined(); if (!request) { throw new Error("expected pairing request"); }