Skip to content

Commit 0154cf8

Browse files
committed
fix
1 parent dcbe790 commit 0154cf8

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

site/e2e/hooks.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,18 @@ export const beforeCoderTest = async (page: Page) => {
2424
const shouldLogResponse =
2525
!response.url().endsWith("/api/v2/deployment/config") &&
2626
!response.url().endsWith("/api/v2/debug/health")
27-
const responseText = shouldLogResponse
28-
? await response.text()
29-
: "skipped..."
27+
28+
let responseText = ""
29+
try {
30+
if (shouldLogResponse) {
31+
const buffer = await response.body() // Read the response as a buffer
32+
responseText = buffer.toString("utf-8") // Convert the buffer to text
33+
} else {
34+
responseText = "skipped..."
35+
}
36+
} catch (error) {
37+
responseText = "not_available"
38+
}
3039

3140
// eslint-disable-next-line no-console -- Log HTTP requests for debugging purposes
3241
console.log(

site/e2e/reporter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,6 @@ class CoderReporter implements Reporter {
4848
console.log(`Finished the run: ${result.status}`)
4949
}
5050
}
51+
52+
// eslint-disable-next-line no-unused-vars -- Playwright config uses it
5153
export default CoderReporter

0 commit comments

Comments
 (0)