(handler: Handler, email: string, password: string)
| 17 | const BASE = "http://localhost:4788/api"; |
| 18 | |
| 19 | const signInToken = async (handler: Handler, email: string, password: string): Promise<string> => { |
| 20 | const response = await handler( |
| 21 | new Request("http://localhost:4788/api/auth/sign-in/email", { |
| 22 | method: "POST", |
| 23 | headers: { "content-type": "application/json" }, |
| 24 | body: JSON.stringify({ email, password }), |
| 25 | }), |
| 26 | ); |
| 27 | const token = response.headers.get("set-auth-token"); |
| 28 | assert(response.ok && token, `Test admin sign-in failed (${response.status}).`); |
| 29 | return token; |
| 30 | }; |
| 31 | |
| 32 | // A FetchHttpClient backed by the in-process handler, carrying the admin bearer. |
| 33 | const clientLayer = (handler: Handler, token: string) => |
no test coverage detected