test: tighten pairing provider assertions

This commit is contained in:
Peter Steinberger
2026-05-08 21:05:27 +01:00
parent 986efee29c
commit e63ca03bc9
3 changed files with 7 additions and 4 deletions

View File

@@ -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 () => {

View File

@@ -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");

View File

@@ -83,7 +83,6 @@ function requireFirstPairingRequest(
) {
expect(requests).toHaveLength(1);
const [request] = requests;
expect(request).toBeDefined();
if (!request) {
throw new Error("expected pairing request");
}