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

Function forBrowser

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

Source from the content-addressed store, hash-verified

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

Calls 1

cookieOfFunction · 0.70

Tested by

no test coverage detected