MCPcopy
hub / github.com/garrytan/gstack / createLinuxFixtureDb

Function createLinuxFixtureDb

browse/test/cookie-import-browser.test.ts:126–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124}
125
126function createLinuxFixtureDb() {
127 const db = createFixtureDb(LINUX_FIXTURE_DB);
128 const insert = db.prepare(`INSERT INTO cookies
129 (host_key, name, value, encrypted_value, path, expires_utc, is_secure, is_httponly, has_expires, samesite)
130 VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`);
131
132 const futureExpiry = Number(chromiumEpoch(Math.floor(Date.now() / 1000) + 86400 * 365));
133
134 insert.run('.linux-v10.com', 'sid', '', encryptCookieValue('linux-v10-value', { key: LINUX_V10_KEY, prefix: 'v10' }), '/', futureExpiry, 1, 1, 1, 1);
135 insert.run('.linux-v11.com', 'auth', '', encryptCookieValue('linux-v11-value', { key: LINUX_V11_KEY, prefix: 'v11' }), '/', futureExpiry, 1, 1, 1, 1);
136 insert.run('.linux-plain.com', 'plain', 'plain-linux', Buffer.alloc(0), '/', futureExpiry, 0, 0, 1, 1);
137
138 db.close();
139}
140
141// ─── Mock Setup ─────────────────────────────────────────────────
142// We need to mock:

Callers 1

Calls 5

createFixtureDbFunction · 0.85
chromiumEpochFunction · 0.85
encryptCookieValueFunction · 0.85
runMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected