Skip to content

Commit a19e21b

Browse files
committed
update reporter
1 parent c90d8f7 commit a19e21b

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

e2e/config/reporter.ts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,16 @@ class StkReporter implements Reporter {
4949
}
5050

5151
onTestEnd( test: TestCase, result: TestResult ) {
52-
// Console Reporter similar to Playwright's Dot Reporter:
53-
// '·' for passed test
54-
// '×' for attempt for retry
55-
// 'T' for timed out
56-
// 'F' for failed test
57-
58-
if ( test.outcome() === 'expected' ) {
59-
process.stdout.write( '·' )
60-
} else {
61-
const titlePath = test.titlePath().filter( t => t !== '' ).join( ' › ' )
62-
63-
const out = test.results.length <= test.retries ? '×' : ( result.status === 'timedOut' ? 'T' : 'F' )
64-
process.stdout.write( out )
65-
52+
// Console Reporter similar to Playwright's List Reporter:
53+
const resultMark = test.ok() ? '✓' : '✘'
54+
const titlePath = test.titlePath().filter( t => t !== '' ).join( ' › ' )
55+
const retryLabel = test.results.length > 1 ? `(retry #${ test.results.length - 1 }) ` : ''
56+
const duration = `[${ ms( result.duration ) }]`
57+
console.log( `${ resultMark } ${ titlePath } ${ retryLabel }${ duration }` )
58+
59+
if ( result.status !== test.expectedStatus ) {
6660
// Compile error messages and snippets
67-
let testResult = `${ titlePath } ${ test.results.length > 1 ? `(retry #${ test.results.length - 1 }) ` : '' }[${ ms( result.duration ) }]` + '\n\n'
61+
let testResult = `${ titlePath } ${ retryLabel }${ duration }` + '\n\n'
6862
if ( result.errors.length >= 1 ) {
6963
result.errors.forEach( error => {
7064
if ( error.message ) {

0 commit comments

Comments
 (0)