diff --git a/spec/unit/rust-crypto/rust-crypto.spec.ts b/spec/unit/rust-crypto/rust-crypto.spec.ts index c21e34531..d306166de 100644 --- a/spec/unit/rust-crypto/rust-crypto.spec.ts +++ b/spec/unit/rust-crypto/rust-crypto.spec.ts @@ -578,9 +578,11 @@ describe("RustCrypto", () => { }); describe("findVerificationRequestDMInProgress", () => { - it("returns undefined if the userId is not provided", async () => { + it("throws an error if the userId is not provided", async () => { const rustCrypto = await makeTestRustCrypto(); - expect(rustCrypto.findVerificationRequestDMInProgress(testData.TEST_ROOM_ID)).not.toBeDefined(); + expect(() => rustCrypto.findVerificationRequestDMInProgress(testData.TEST_ROOM_ID)).toThrow( + "missing userId", + ); }); }); }); diff --git a/src/rust-crypto/rust-crypto.ts b/src/rust-crypto/rust-crypto.ts index 8bed4c9e9..788238e6a 100644 --- a/src/rust-crypto/rust-crypto.ts +++ b/src/rust-crypto/rust-crypto.ts @@ -686,8 +686,7 @@ export class RustCrypto extends TypedEventEmitter