(identity: Identity)
| 48 | * browser context is seeded from `cookies`. |
| 49 | */ |
| 50 | export const forBrowser = (identity: Identity): Identity => { |
| 51 | const cookie = cookieOf(identity); |
| 52 | const separator = cookie.indexOf("="); |
| 53 | if (separator < 0) throw new Error("identity carries no session cookie"); |
| 54 | return { |
| 55 | ...identity, |
| 56 | cookies: [{ name: cookie.slice(0, separator), value: cookie.slice(separator + 1) }], |
| 57 | }; |
| 58 | }; |
| 59 | |
| 60 | /** POST as `identity`, failing loudly on a non-2xx (a silent skip here would |
| 61 | * leave the scenario asserting against a half-built fixture). |
no test coverage detected