Cookie scanner, phase 2: browser crawl through a shared scanner service

cookieScanner.crawl (opt-in) adds "Crawl site" to the Cookie review box. The
site asks the shared scanner service (services/cookie-crawler: Node +
Playwright, Dockerfile, deployed once on Coolify) to crawl its sitemap pages
twice, with no consent and after "Accept all". The service posts cookies,
storage keys and third-party hosts back to POST /api/ipal/cookie-crawl/results
(bearer token, running job only). No browser in the site.

Findings land as drafts through the same merge rules. Anything stored before
consent that is not necessary, and tracker requests before consent, are
violations, flagged on the review entries from the latest crawl only. The
cookie-crawl global keeps the latest result (no history). A dashboard warning
(CookieCrawlAlert) and an opt-in e-mail through the project's mail adapter
follow a crawl with violations or new unknown cookies. Scheduled crawls: a
Coolify scheduled task with the token. ipalEnvRules({ cookieCrawl: true }).

Also: the six older real-Payload tests no longer leave an orphaned
payload generate:types process (typescript.autoGenerate: false).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-27 15:14:01 +01:00
co-authored by Claude Opus 5.5
parent 4f69f6ed20
commit 4bb9c663fd
44 changed files with 2165 additions and 36 deletions
+1
View File
@@ -47,6 +47,7 @@ describe('under construction — Site Settings → createPageRoute', () => {
plugins: [ipalKit({ access: { authCollection: 'users' }, i18n, pages: { slug: 'pages' }, twoFactor: false })],
secret: 'construction-test-secret',
telemetry: false,
typescript: { autoGenerate: false }, // no orphaned `payload generate:types` child
})
payload = await getPayload({ config: configPromise })
}, 60_000)
+171
View File
@@ -0,0 +1,171 @@
/**
* Phase 2 end to end: a REAL Payload (SQLite, pl + en) and a REAL Chromium crawl
* (services/cookie-crawler) of a small local test site. Only the HTTP hop
* between site and service is short-circuited (that hop: cookieCrawler.test.ts).
*/
import type { Server } from 'node:http'
import type { AddressInfo } from 'node:net'
import type { Payload } from 'payload'
import { sqliteAdapter } from '@payloadcms/db-sqlite'
import { lexicalEditor } from '@payloadcms/richtext-lexical'
import { chromium } from '@playwright/test'
import { createServer } from 'node:http'
import os from 'os'
import path from 'path'
import { buildConfig, getPayload } from 'payload'
import { afterAll, beforeAll, describe, expect, test, vi } from 'vitest'
import { crawlSite } from '../services/cookie-crawler/crawl.mjs'
import { CookieCrawlAlert } from '../src/modules/consent/scanner/crawl/CookieCrawlAlert.js'
import { buildCookieCrawlEndpoints } from '../src/modules/consent/scanner/crawl/endpoints.js'
import { COOKIE_SCAN_LABELS } from '../src/modules/consent/scanner/labels.js'
import { ipalKit } from '../src/plugin.js'
vi.mock('server-only', () => ({}))
type CrawlDoc = { status: string; summary: { pages: number; violations: number }; violations: { name: string }[] }
const TOKEN = 't'.repeat(32)
const editor = { collection: 'users', email: '[email protected]', roles: ['editor'] }
// The test site: `sid` (declared necessary) and `_fbp` + a tracker request before consent;
// `_ga` and a localStorage key only after "Accept all".
const PAGE = (body: string) => `<!doctype html><html><body>${body}</body></html>`
const site: Server = createServer((req, res) => {
if (req.url === '/sitemap.xml') {
res.writeHead(200, { 'Content-Type': 'application/xml' })
res.end(`<urlset><url><loc>${siteUrl}/about</loc></url></urlset>`)
return
}
res.writeHead(200, { 'Content-Type': 'text/html', 'Set-Cookie': 'sid=1; Path=/' })
res.end(
req.url === '/about'
? PAGE('<p>About</p>')
: PAGE(`<script>document.cookie='_fbp=fb.1; path=/'</script>
<img src="http://tracker.invalid/p.gif" alt="">
<button data-ipal="accept" onclick="document.cookie='_ga=GA1; path=/';localStorage.setItem('ipal-theme','dark')">Accept all</button>`),
)
})
let siteUrl = ''
let payload: Payload
const crawlOptions = () => ({ serviceUrl: 'http://crawler.test', siteUrl, token: TOKEN, trackerHosts: (d: string[]) => [...d, 'tracker.invalid'] })
const declarations = [{ name: 'sid', category: 'necessary' as const, purpose: 'Session', retention: 'Session', setBeforeConsent: true, vendor: 'This site' }]
beforeAll(async () => {
await new Promise<void>((r) => site.listen(0, '127.0.0.1', r))
siteUrl = `http://127.0.0.1:${(site.address() as AddressInfo).port}`
payload = await getPayload({
config: buildConfig({
collections: [
{ slug: 'users', auth: true, fields: [] },
{ slug: 'media', fields: [], upload: { staticDir: path.join(os.tmpdir(), 'ipal-test-media') } },
],
db: sqliteAdapter({ client: { url: 'file::memory:' }, push: true }),
editor: lexicalEditor(),
plugins: [
ipalKit({
access: { authCollection: 'users' },
cookieScanner: { crawl: crawlOptions(), declarations },
i18n: { defaultLocale: 'pl', locales: [{ code: 'pl', label: 'Polski' }, { code: 'en', label: 'English' }] },
twoFactor: false,
}),
],
secret: 'cookie-crawl-test-secret',
telemetry: false,
typescript: { autoGenerate: false },
}),
})
}, 60_000)
afterAll(async () => {
await payload?.destroy()
await new Promise<void>((r) => site.close(() => r()))
})
describe('cookie crawl — panel button → service → results', () => {
const started: Record<string, unknown>[] = []
const fetchImpl = vi.fn(async (_url: Request | string | URL, init?: RequestInit) => {
started.push(JSON.parse(init?.body as string))
return new Response('{}', { status: 202 })
}) as unknown as typeof fetch
const endpoints = () =>
buildCookieCrawlEndpoints({ fetchImpl, labels: COOKIE_SCAN_LABELS, options: { crawl: crawlOptions(), declarations }, plugin: { localeCount: 2, stats: false } })
const call = (i: number, { body = {}, token, user = null }: { body?: unknown; token?: string; user?: unknown } = {}) =>
endpoints()[i].handler({
headers: new Headers(token ? { authorization: `Bearer ${token}` } : {}),
json: async () => body,
payload,
user,
} as never) as Promise<Response>
const review = async (name: string, storage = 'cookie') =>
(await payload.find({ collection: 'cookie-review' as never, depth: 0, where: { key: { equals: `${storage}:${name}` } } })).docs[0] as unknown as Record<string, unknown>
test('visitors cannot start a crawl; an editor can; a second start while running is refused', async () => {
expect((await call(1)).status).toBe(403)
expect((await call(1, { user: { ...editor, roles: ['user'] } })).status).toBe(403)
expect((await call(1, { user: editor })).status).toBe(202)
expect(started[0]).toMatchObject({ callbackUrl: `${siteUrl}/api/ipal/cookie-crawl/results`, maxPages: 20, siteUrl })
expect((await call(1, { user: editor })).status).toBe(409)
const status = (await (await call(0, { user: editor })).json()) as Record<string, unknown>
expect(status).toMatchObject({ configured: true, status: 'running' })
})
test('results need the token and the running job id', async () => {
const jobId = started[0].jobId as string
expect((await call(2, { body: { jobId, observations: [], ok: true, pages: [], requests: [] } })).status).toBe(401)
expect((await call(2, { body: { jobId: 'a'.repeat(32), observations: [], ok: true, pages: [], requests: [] }, token: TOKEN })).status).toBe(409)
})
test('a real browser crawl lands as drafts with violations, a dashboard warning and an e-mail', async () => {
await payload.updateGlobal({ slug: 'cookie-crawl' as never, data: { notifyEmails: '[email protected]' } as never })
const sendEmail = vi.spyOn(payload, 'sendEmail').mockResolvedValue(undefined as never)
const result = await crawlSite({ chromium, maxPages: 5, siteUrl, waitMs: 300 })
expect(result.accepted).toBe(true)
expect(result.pages).toEqual(['/', '/about'])
const res = await call(2, { body: { ...result, jobId: started[0].jobId }, token: TOKEN })
expect(res.status).toBe(200)
expect(await review('sid')).toMatchObject({ seenBeforeConsent: true, status: 'draft', violation: false })
expect(await review('_fbp')).toMatchObject({ category: 'marketing', seenBeforeConsent: true, violation: true })
expect(await review('_ga')).toMatchObject({ seenBeforeConsent: false, status: 'draft', violation: false })
expect(await review('ipal-theme', 'localStorage')).toMatchObject({ source: 'unknown', status: 'draft' })
const crawl = (await payload.findGlobal({ slug: 'cookie-crawl' as never })) as unknown as CrawlDoc
expect(crawl.status).toBe('done')
expect(crawl.summary).toMatchObject({ pages: 2, violations: 2 })
expect(crawl.violations.map((v: { name: string }) => v.name).sort()).toEqual(['_fbp', 'tracker.invalid'])
expect(sendEmail).toHaveBeenCalledWith(expect.objectContaining({ subject: expect.stringContaining('2'), to: ['[email protected]'] }))
expect(await CookieCrawlAlert({ payload })).not.toBeNull()
sendEmail.mockRestore()
}, 60_000)
test('only the latest crawl counts: a clean crawl clears the flags; status and entries stay', async () => {
const fbp = await review('_fbp')
await payload.update({ id: fbp.id as number, collection: 'cookie-review' as never, data: { status: 'rejected' } as never })
const before = (await payload.count({ collection: 'cookie-review' as never })).totalDocs
expect((await call(1, { token: TOKEN })).status).toBe(202) // a scheduled task authenticates with the token
const jobId = started.at(-1)!.jobId
const clean = { accepted: true, jobId, observations: [{ name: 'sid', after: true, before: true, pages: ['/'], storage: 'cookie' }], ok: true, pages: ['/'], requests: [] }
expect((await call(2, { body: clean, token: TOKEN })).status).toBe(200)
expect(await review('_fbp')).toMatchObject({ seenBeforeConsent: false, status: 'rejected', violation: false })
expect((await payload.count({ collection: 'cookie-review' as never })).totalDocs).toBe(before)
const crawl = (await payload.findGlobal({ slug: 'cookie-crawl' as never })) as unknown as CrawlDoc
expect(crawl.summary.violations).toBe(0)
expect(await CookieCrawlAlert({ payload })).toBeNull()
})
test('a failed crawl is reported and the next one may start', async () => {
expect((await call(1, { user: editor })).status).toBe(202)
const jobId = started.at(-1)!.jobId
expect((await call(2, { body: { error: 'site down', jobId, ok: false }, token: TOKEN })).status).toBe(200)
const status = (await (await call(0, { user: editor })).json()) as Record<string, unknown>
expect(status).toMatchObject({ error: 'site down', status: 'failed' })
expect(await CookieCrawlAlert({ payload })).not.toBeNull()
})
})
+193
View File
@@ -0,0 +1,193 @@
import type { AddressInfo } from 'node:net'
/**
* The scanner service (services/cookie-crawler) without a browser, and the
* site side's pure pieces: wire format, violations, token check, config.
*/
import type { BasePayload } from 'payload'
import { afterEach, describe, expect, test, vi } from 'vitest'
import { checkCrawlRequest, discoverPages, isFirstParty, mergeRuns, parseSites } from '../services/cookie-crawler/lib.mjs'
import { createCrawlerServer } from '../services/cookie-crawler/server.mjs'
import { resolveCrawlConfig } from '../src/modules/consent/scanner/crawl/config.js'
import { bearerMatches } from '../src/modules/consent/scanner/crawl/endpoints.js'
import { parseCrawlResult } from '../src/modules/consent/scanner/crawl/result.js'
import { findCrawlViolations } from '../src/modules/consent/scanner/crawl/violations.js'
const TOKEN = 'a'.repeat(32)
const JOB = 'f'.repeat(32)
const sites = parseSites(`acme.pl=${TOKEN}, shop.example.com=${'b'.repeat(32)},short.pl=123`)
describe('crawler service — request checks', () => {
test('sites: host=token pairs, www dropped, short tokens refused', () => {
expect(sites).toEqual([
{ host: 'acme.pl', token: TOKEN },
{ host: 'shop.example.com', token: 'b'.repeat(32) },
])
})
const body = { callbackUrl: 'https://www.acme.pl/api/ipal/cookie-crawl/results', jobId: JOB, siteUrl: 'https://www.acme.pl' }
const check = (b: object, authorization = `Bearer ${TOKEN}`, allowHttp = false) => checkCrawlRequest({ allowHttp, authorization, body: b, sites })
test('a listed site with its own token passes', () => {
expect(check(body)).toBeNull()
})
test('refuses other sites, other tokens, foreign callbacks, http, bad job ids', () => {
expect(check({ ...body, callbackUrl: 'https://evil.com/x', siteUrl: 'https://evil.com' })).toBe('site_not_allowed')
expect(check(body, `Bearer ${'b'.repeat(32)}`)).toBe('unauthorized') // shop's token cannot crawl acme
expect(check(body, '')).toBe('unauthorized')
expect(check({ ...body, callbackUrl: 'https://evil.com/collect' })).toBe('callback_not_on_site')
expect(check({ ...body, callbackUrl: 'http://acme.pl/x', siteUrl: 'http://acme.pl' })).toBe('https_only')
expect(check({ ...body, callbackUrl: 'http://acme.pl/x', siteUrl: 'http://acme.pl' }, `Bearer ${TOKEN}`, true)).toBeNull()
expect(check({ ...body, jobId: '../etc' })).toBe('bad_job_id')
expect(check(null as never)).toBe('bad_request')
})
})
describe('crawler service — pages and runs', () => {
test('pages from the sitemap index: same origin only, capped', async () => {
const files: Record<string, string> = {
'https://acme.pl/sitemap.xml': '<sitemapindex><sitemap><loc>https://acme.pl/sitemap-pages.xml</loc></sitemap></sitemapindex>',
'https://acme.pl/sitemap-pages.xml': '<urlset><url><loc>https://acme.pl/pl</loc></url><url><loc>https://evil.com/x</loc></url><url><loc>https://acme.pl/en</loc></url><url><loc>https://acme.pl/de</loc></url></urlset>',
}
const fakeFetch = vi.fn(async (url: string) => new Response(files[url] ?? '', { status: files[url] ? 200 : 404 }))
expect(await discoverPages('https://acme.pl/', 2, fakeFetch as unknown as typeof fetch)).toEqual(['https://acme.pl/', 'https://acme.pl/pl', 'https://acme.pl/en'])
const offline = vi.fn(async () => { throw new Error('down') })
expect(await discoverPages('https://acme.pl/', 5, offline as unknown as typeof fetch)).toEqual(['https://acme.pl/'])
})
test('first party includes subdomains', () => {
expect(isFirstParty('www.acme.pl', 'acme.pl')).toBe(true)
expect(isFirstParty('cdn.acme.pl', 'acme.pl')).toBe(true)
expect(isFirstParty('notacme.pl', 'acme.pl')).toBe(false)
})
test('two runs merge into before/after flags with the first pages', () => {
const { observations, requests } = mergeRuns(
{ cookies: [{ name: 'sid', domain: '.acme.pl', page: '/' }], requests: [{ host: 'connect.facebook.net', page: '/' }], storage: [] },
{
cookies: [{ name: 'sid', domain: 'acme.pl', page: '/' }, { name: '_ga', domain: '.acme.pl', page: '/' }, { name: '_ga', domain: '.acme.pl', page: '/en' }],
requests: [],
storage: [{ name: 'ipal-theme', page: '/', storage: 'localStorage' }],
},
)
expect(observations).toEqual([
{ name: 'sid', after: true, before: true, domain: 'acme.pl', pages: ['/'], storage: 'cookie' },
{ name: '_ga', after: true, before: false, domain: 'acme.pl', pages: ['/', '/en'], storage: 'cookie' },
{ name: 'ipal-theme', after: true, before: false, pages: ['/'], storage: 'localStorage' },
])
expect(requests).toEqual([{ after: false, before: true, host: 'connect.facebook.net', pages: ['/'] }])
})
})
describe('crawler service — HTTP', () => {
let close: (() => Promise<void>) | undefined
afterEach(async () => {
await close?.()
close = undefined
})
async function start(crawl: (job: unknown) => Promise<unknown>, extra: Record<string, unknown> = {}) {
const delivered: { auth: null | string; body: Record<string, unknown>; url: string }[] = []
const fetchImpl = vi.fn(async (url: string, init: RequestInit) => {
delivered.push({ auth: new Headers(init.headers).get('authorization'), body: JSON.parse(init.body as string), url })
return new Response('{}', { status: 200 })
})
const server = createCrawlerServer({ allowHttp: true, crawl, deliveryDelays: [0], fetchImpl: fetchImpl as unknown as typeof fetch, log: () => {}, sites, ...extra }) as { whenIdle: () => Promise<void> } & ReturnType<typeof createCrawlerServer>
await new Promise<void>((r) => server.listen(0, '127.0.0.1', r))
close = () => new Promise<void>((r) => server.close(() => r()))
const base = `http://127.0.0.1:${(server.address() as AddressInfo).port}`
const post = (body: unknown, token = TOKEN) =>
fetch(`${base}/crawl`, { body: JSON.stringify(body), headers: { Authorization: `Bearer ${token}` }, method: 'POST' })
return { base, delivered, post, server }
}
const job = { callbackUrl: 'https://acme.pl/api/ipal/cookie-crawl/results', jobId: JOB, siteUrl: 'https://acme.pl' }
test('202, crawl in the background, result posted back with the site token', async () => {
const crawl = vi.fn(async () => ({ accepted: true, observations: [], ok: true, pages: ['/'], requests: [] }))
const { base, delivered, post, server } = await start(crawl)
expect((await fetch(`${base}/health`)).status).toBe(200)
const res = await post(job)
expect(res.status).toBe(202)
await server.whenIdle()
expect(crawl).toHaveBeenCalledWith(expect.objectContaining({ maxPages: 20, siteUrl: 'https://acme.pl' }))
expect(delivered).toEqual([{ auth: `Bearer ${TOKEN}`, body: expect.objectContaining({ jobId: JOB, ok: true }), url: job.callbackUrl }])
})
test('401 for a wrong token, 404 elsewhere, a crash or timeout is reported as ok:false', async () => {
const { base, delivered, post, server } = await start(() => new Promise(() => {}), { jobTimeoutMs: 50 })
expect((await post(job, 'x'.repeat(32))).status).toBe(401)
expect((await fetch(`${base}/nope`)).status).toBe(404)
expect((await post(job)).status).toBe(202)
await server.whenIdle()
expect(delivered[0].body).toMatchObject({ error: expect.stringContaining('longer than 50 ms'), jobId: JOB, ok: false })
})
test('a full queue answers 429', async () => {
const { post } = await start(() => new Promise(() => {}), { jobTimeoutMs: 60_000, queueMax: 1 })
expect((await post(job)).status).toBe(202) // running
expect((await post(job)).status).toBe(202) // queued
expect((await post(job)).status).toBe(429)
})
})
describe('crawl — site side', () => {
test('the wire format is validated, junk dropped', () => {
expect(parseCrawlResult({ jobId: 'nope', ok: true })).toBeNull()
expect(parseCrawlResult({ error: 'boom', jobId: JOB, ok: false })).toEqual({ error: 'boom', jobId: JOB, ok: false })
const r = parseCrawlResult({
jobId: JOB,
observations: [
{ name: '_ga', after: true, before: true, domain: '.Acme.pl', pages: ['/'], storage: 'cookie' },
{ name: 'bad name', storage: 'cookie' },
{ name: 'x', storage: 'indexedDB' },
],
ok: true,
pages: ['/', 3],
requests: [{ before: true, host: 'connect.facebook.net' }, { host: 'not a host' }],
})
expect(r).toEqual({
accepted: true,
jobId: JOB,
observations: [{ name: '_ga', after: true, before: true, domain: 'acme.pl', pages: ['/'], storage: 'cookie' }],
ok: true,
pages: ['/'],
requests: [{ after: false, before: true, host: 'connect.facebook.net', pages: [] }],
})
})
test('violations: stored before consent and not necessary; tracker hosts; Google only in basic mode', () => {
const o = (name: string, before: boolean) => ({ name, after: true, before, pages: ['/'], storage: 'cookie' as const })
const categories: Record<string, null | string> = { _fbp: 'marketing', 'cookie-consent': 'necessary', mystery: null }
const args = {
categoryOf: (x: { name: string }) => categories[x.name],
observations: [o('cookie-consent', true), o('_fbp', true), o('mystery', true), o('_ga', false)],
requests: [
{ after: true, before: true, host: 'connect.facebook.net', pages: ['/'] },
{ after: true, before: true, host: 'www.googletagmanager.com', pages: ['/'] },
{ after: true, before: false, host: 'px.ads.linkedin.com', pages: ['/'] },
],
}
expect(findCrawlViolations(args).map((v) => v.name)).toEqual(['_fbp', 'mystery', 'connect.facebook.net'])
expect(findCrawlViolations({ ...args, consentMode: 'basic' }).map((v) => v.name)).toContain('www.googletagmanager.com')
expect(findCrawlViolations({ ...args, trackerHosts: [] }).map((v) => v.kind)).toEqual(['cookie', 'cookie'])
})
test('bearer token: constant-time match, nothing without a token', () => {
expect(bearerMatches(`Bearer ${TOKEN}`, TOKEN)).toBe(true)
expect(bearerMatches(`Bearer ${TOKEN}x`, TOKEN)).toBe(false)
expect(bearerMatches(TOKEN, TOKEN)).toBe(false)
expect(bearerMatches(`Bearer ${TOKEN}`, null)).toBe(false)
})
test('config: options, then env, then Payload serverURL; short tokens are not a token', () => {
const payload = { config: { serverURL: 'https://acme.pl/' } } as unknown as BasePayload
vi.stubEnv('IPAL_COOKIE_SCAN_URL', 'https://crawler.intecion.net/')
vi.stubEnv('IPAL_COOKIE_SCAN_TOKEN', 'short')
const c = resolveCrawlConfig({ maxPages: 500 }, payload)
expect(c).toMatchObject({ maxPages: 100, serviceUrl: 'https://crawler.intecion.net', siteUrl: 'https://acme.pl', token: null })
expect(resolveCrawlConfig({ token: TOKEN, trackerHosts: (d) => [...d, 'chat.example'] }, payload).trackerHosts).toContain('chat.example')
vi.unstubAllEnvs()
})
})
+2
View File
@@ -237,6 +237,8 @@ describe('agent guide covers the whole plugin', () => {
...typeKeys('src/modules/content/types.ts', 'ContentCollectionOption'),
...typeKeys('src/modules/content/types.ts', 'ContentOption'),
...typeKeys('src/modules/consent/scanner/types.ts', 'CookieScannerOptions'),
...typeKeys('src/modules/consent/scanner/types.ts', 'CookieCrawlOptions'),
...typeKeys('src/modules/env/ipalEnvRules.ts', 'IpalEnvFeatures'),
...typeKeys('src/modules/forms/types.ts', 'FormsOption'),
...typeKeys('src/modules/i18n/types.ts', 'I18nConfig'),
...typeKeys('src/modules/i18n/types.ts', 'LocaleDefinition'),
+1
View File
@@ -42,6 +42,7 @@ beforeAll(async () => {
],
secret: 'drafts-test',
telemetry: false,
typescript: { autoGenerate: false }, // no orphaned `payload generate:types` child
})
payload = await getPayload({ config })
}, 60_000)
+1
View File
@@ -53,6 +53,7 @@ beforeAll(async () => {
],
secret: 'integration-test-secret',
telemetry: false,
typescript: { autoGenerate: false }, // no orphaned `payload generate:types` child
})
configPromise = config
payload = await getPayload({ config })
+1
View File
@@ -120,6 +120,7 @@ describe('createSeeder', () => {
plugins: [ipalKit({ i18n: { defaultLocale: 'pl', locales: [{ code: 'pl', label: 'PL' }, { code: 'en', label: 'EN' }] }, indexNow: true, pages: { slug: 'pages' }, twoFactor: false })],
secret: 'seed-test-secret',
telemetry: false,
typescript: { autoGenerate: false }, // no orphaned `payload generate:types` child
})
payload = await getPayload({ config })
}, 60_000)
+1
View File
@@ -44,6 +44,7 @@ describe('SEO outputs against a real database', () => {
plugins: [ipalKit({ access: { authCollection: 'users' }, i18n, pages: { slug: 'pages' }, twoFactor: false })],
secret: 'seo-integration-test-secret',
telemetry: false,
typescript: { autoGenerate: false }, // no orphaned `payload generate:types` child
})
payload = await getPayload({ config: configPromise })
+1
View File
@@ -45,6 +45,7 @@ beforeAll(async () => {
],
secret: 'depth-test',
telemetry: false,
typescript: { autoGenerate: false }, // no orphaned `payload generate:types` child
})
payload = await getPayload({ config: configPromise })
const png = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==', 'base64')