MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / expectRejection

Function expectRejection

packages/cli/src/auth/loopback.test.ts:31–40  ·  view source on GitHub ↗
(args: {
    expectedState: string;
    query: string;
    pattern: RegExp;
  })

Source from the content-addressed store, hash-verified

29 });
30
31 async function expectRejection(args: {
32 expectedState: string;
33 query: string;
34 pattern: RegExp;
35 }): Promise<void> {
36 const handle = await startLoopback({ state: args.expectedState, timeoutMs: 5_000 });
37 active = handle;
38 await fetch(`${handle.redirectUri}?${args.query}`).catch(() => {});
39 await expect(handle.result).rejects.toThrow(args.pattern);
40 }
41
42 it("rejects when state does not match", async () => {
43 await expectRejection({

Callers 1

loopback.test.tsFile · 0.85

Calls 2

startLoopbackFunction · 0.85
fetchFunction · 0.85

Tested by

no test coverage detected