Skip to content

Fixing issue #69

Fixing issue #69 #10

Triggered via dynamic June 19, 2025 00:19
Status Success
Total duration 15m 42s
Artifacts 1

copilot

on: dynamic
Fit to window
Zoom out
Zoom in

Annotations

1 error
../server/api/inspect-url.post.nuxt.test.ts > inspect-url.post API > should pass ignoreResponseError option to $fetch.raw to handle non-success status codes: server/api/inspect-url.post.nuxt.test.ts#L20
AssertionError: expected 'import { createHash } from \'crypto\'…' to match /\$fetch\.raw\(url,\s*{[^}]*ignoreRes…/s - Expected: /\$fetch\.raw\(url,\s*{[^}]*ignoreResponseError:\s*true[^}]*}\)/s + Received: "import { createHash } from 'crypto' import { saveRun } from '~server/db' const generateRunId = (url: string, timestamp: number): string => createHash('sha256') .update(`${url}-${timestamp}`) .digest('hex') .slice(0, 8) export default defineEventHandler(async (event) => { const { url } = await readBody(event) if (!url) { throw createError({ statusCode: 400, message: 'Please provide a URL to inspect', }) } const startTime = Date.now() const { status, headers } = await $fetch.raw(url, { headers: { 'x-nf-debug-logging': '1', }, ignoreResponseError: true, }) const durationInMs = Date.now() - startTime // TODO(serhalp) What about sites with an extra proxy on top? Maybe check for a debug response // header instead? if (headers.get('Server') !== 'Netlify') { throw createError({ statusCode: 400, message: 'This tool can only be used with Netlify sites', }) } const run = { runId: generateRunId(url, Date.now()), url, status, headers: Object.fromEntries(headers), durationInMs, } await saveRun(run) return run }) " ❯ ../server/api/inspect-url.post.nuxt.test.ts:20:28

Artifacts

Produced during runtime
Name Size Digest
results
1.88 KB
sha256:b9fdbc7954816e10007e04c6b6c6120e50c3447100a6b59194a3a4f142610bd5