File tree 2 files changed +14
-3
lines changed 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -24,9 +24,18 @@ export const beforeCoderTest = async (page: Page) => {
24
24
const shouldLogResponse =
25
25
! response . url ( ) . endsWith ( "/api/v2/deployment/config" ) &&
26
26
! 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
+ }
30
39
31
40
// eslint-disable-next-line no-console -- Log HTTP requests for debugging purposes
32
41
console . log (
Original file line number Diff line number Diff line change @@ -48,4 +48,6 @@ class CoderReporter implements Reporter {
48
48
console . log ( `Finished the run: ${ result . status } ` )
49
49
}
50
50
}
51
+
52
+ // eslint-disable-next-line no-unused-vars -- Playwright config uses it
51
53
export default CoderReporter
You can’t perform that action at this time.
0 commit comments