(args: {
expectedState: string;
query: string;
pattern: RegExp;
})
| 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({ |
no test coverage detected