1
+ /* eslint-disable no-console -- Logging is sort of the whole point here */
1
2
import * as fs from "fs" ;
2
3
import type {
3
4
FullConfig ,
@@ -20,13 +21,11 @@ class CoderReporter implements Reporter {
20
21
21
22
onBegin ( config :FullConfig , suite :Suite ) {
22
23
this . config = config ;
23
- // eslint-disable-next-line no-console -- Helpful for debugging
24
24
console . log ( `==> Running${ suite . allTests ( ) . length } tests` ) ;
25
25
}
26
26
27
27
onTestBegin ( test :TestCase ) {
28
28
this . testOutput . set ( test . id , [ ] ) ;
29
- // eslint-disable-next-line no-console -- Helpful for debugging
30
29
console . log ( `==> Starting test${ test . title } ` ) ;
31
30
}
32
31
@@ -53,7 +52,7 @@ class CoderReporter implements Reporter {
53
52
}
54
53
55
54
async onTestEnd ( test :TestCase , result :TestResult ) {
56
- console . log ( `==> Finished test${ test . title } :${ result . status } ` ) ; // eslint-disable-line no-console -- Helpful for debugging
55
+ console . log ( `==> Finished test${ test . title } :${ result . status } ` ) ;
57
56
58
57
if ( result . status === "passed" ) {
59
58
this . passedCount ++ ;
@@ -72,24 +71,22 @@ class CoderReporter implements Reporter {
72
71
preserve === "always" ||
73
72
( result . status !== "passed" && preserve !== "never" ) ;
74
73
if ( logOutput ) {
75
- console . log ( "==> Output" ) ; // eslint-disable-line no-console -- Debugging output
74
+ console . log ( "==> Output" ) ;
76
75
const output = this . testOutput . get ( test . id ) ! ;
77
76
for ( const [ target , chunk ] of output ) {
78
77
target . write ( `${ chunk . replace ( / \n $ / g, "" ) } \n` ) ;
79
78
}
80
79
81
80
if ( result . errors . length > 0 ) {
82
- console . log ( "==> Errors" ) ; // eslint-disable-line no-console -- Debugging output
81
+ console . log ( "==> Errors" ) ;
83
82
for ( const error of result . errors ) {
84
83
reportError ( error ) ;
85
84
}
86
85
}
87
86
88
87
if ( result . attachments . length > 0 ) {
89
- // eslint-disable-next-line no-console -- Debugging output
90
88
console . log ( "==> Attachments" ) ;
91
89
for ( const attachment of result . attachments ) {
92
- // eslint-disable-next-line no-console -- Debugging output
93
90
console . log ( attachment ) ;
94
91
}
95
92
}
@@ -100,7 +97,6 @@ class CoderReporter implements Reporter {
100
97
}
101
98
102
99
onEnd ( result :FullResult ) {
103
- // eslint-disable-next-line no-console -- Helpful for debugging
104
100
console . log ( `==> Tests${ result . status } ` ) ;
105
101
console . log ( `${ this . passedCount } passed` ) ;
106
102
if ( this . failedTests . length > 0 ) {
@@ -133,7 +129,6 @@ const exportDebugPprof = async (testName: string) => {
133
129
if ( err ) {
134
130
throw new Error ( `Error writing to${ outputFile } :${ err . message } ` ) ;
135
131
} else {
136
- // eslint-disable-next-line no-console -- Helpful for debugging
137
132
console . log ( `Data from${ url } has been saved to${ outputFile } ` ) ;
138
133
}
139
134
} ) ;
@@ -145,19 +140,15 @@ const exportDebugPprof = async (testName: string) => {
145
140
146
141
const reportError = ( error :TestError ) => {
147
142
if ( error . location ) {
148
- // eslint-disable-next-line no-console -- Debugging output
149
143
console . log ( `${ error . location . file } :${ error . location . line } :` ) ;
150
144
}
151
145
if ( error . snippet ) {
152
- // eslint-disable-next-line no-console -- Debugging output
153
146
console . log ( error . snippet ) ;
154
147
}
155
148
156
149
if ( error . message ) {
157
- // eslint-disable-next-line no-console -- Debugging output
158
150
console . log ( error . message ) ;
159
151
} else {
160
- // eslint-disable-next-line no-console -- Debugging output
161
152
console . log ( error ) ;
162
153
}
163
154
} ;