MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / forBrowser

Function forBrowser

e2e/cloud/support/session.ts:51–59  ·  view source on GitHub ↗
(identity: Identity)

Source from the content-addressed store, hash-verified

49 * browser context is seeded from `cookies`.
50 */
51export 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).

Calls 1

cookieOfFunction · 0.70

Tested by

no test coverage detected