Skip to content

Commit 93cb3c4

Browse files
committed
test(e2e): debug response, increase delay
1 parent 25b677b commit 93cb3c4

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

feature-runner/steps.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,20 @@ export const steps = ({
5656
step.title,
5757
)
5858
if (match === null) return noMatch
59-
const res = await (await fetch(match?.groups?.url ?? '')).json()
60-
debug(res)
61-
check(res).is(objectMatching(JSON.parse(codeBlockOrThrow(step).code)))
59+
const res = await fetch(match?.groups?.url ?? '')
60+
res.headers.forEach((v, k) => debug(`${v}: ${k}`))
61+
const body = await res.text()
62+
debug(body)
63+
let registry: Record<string, any> = {}
64+
try {
65+
registry = JSON.parse(body)
66+
} catch {
67+
throw new Error(`Failed to parse body as JSON: ${body}`)
68+
}
69+
check(registry).is(
70+
objectMatching(JSON.parse(codeBlockOrThrow(step).code)),
71+
)
72+
return registry
6273
},
6374
],
6475
cleanup: async () => {

features/GetParameters.feature.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
retry:
3-
initialDelay: 1000
3+
initialDelay: 5000
44
---
55

66
# Get Parameters

0 commit comments

Comments
 (0)