mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 12:57:46 +00:00
[tests] Add x-vercel-id to test error message (#10149)
Including the `x-vercel-id` header when a e2e test fails will help us debug issues
This commit is contained in:
@@ -44,7 +44,9 @@ function fetchWithRetry(url, opts = {}) {
|
||||
if (res.status !== opts.status) {
|
||||
const text = await res.text();
|
||||
throw new Error(
|
||||
`Failed to fetch ${url} with status ${res.status} (expected ${opts.status}):\n\n${text}\n\n`
|
||||
`Failed to fetch "${url}", received ${res.status}, expected ${
|
||||
opts.status
|
||||
}, id: ${res.headers.get('x-vercel-id')}:\n\n${text}\n\n`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
4
packages/cli/test/integration-1.test.ts
vendored
4
packages/cli/test/integration-1.test.ts
vendored
@@ -32,7 +32,9 @@ function fetchTokenInformation(token: string, retries = 3) {
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(
|
||||
`Failed to fetch ${url}, received status ${res.status}`
|
||||
`Failed to fetch "${url}", status: ${
|
||||
res.status
|
||||
}, id: ${res.headers.get('x-vercel-id')}`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
4
packages/cli/test/integration-2.test.ts
vendored
4
packages/cli/test/integration-2.test.ts
vendored
@@ -43,7 +43,9 @@ function fetchTokenInformation(token: string, retries = 3) {
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(
|
||||
`Failed to fetch ${url}, received status ${res.status}`
|
||||
`Failed to fetch "${url}", status: ${
|
||||
res.status
|
||||
}, id: ${res.headers.get('x-vercel-id')}`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
4
packages/cli/test/integration-3.test.ts
vendored
4
packages/cli/test/integration-3.test.ts
vendored
@@ -47,7 +47,9 @@ function fetchTokenInformation(token: string, retries = 3) {
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(
|
||||
`Failed to fetch ${url}, received status ${res.status}`
|
||||
`Failed to fetch "${url}", status: ${
|
||||
res.status
|
||||
}, id: ${res.headers.get('x-vercel-id')}`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user