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