MCPcopy
hub / github.com/nuxt/nuxt / extractCookie

Function extractCookie

test/basic.test.ts:790–794  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

788 it('updates cookies when they are changed', async () => {
789 const { page } = await renderPage('/cookies')
790 async function extractCookie () {
791 const cookie = await page.evaluate(() => document.cookie)
792 const raw = cookie.match(/browser-object-default=([^;]*)/)![1] ?? 'null'
793 return JSON.parse(decodeURIComponent(raw))
794 }
795 expect(await extractCookie()).toEqual({ foo: 'bar' })
796 await page.getByText('Change cookie').click()
797 expect(await extractCookie()).toEqual({ foo: 'baz' })

Callers 1

basic.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…