Skip to content

Commit cb3db64

Browse files
committed
Fix symbols differences on Windows
1 parent eb5a5fe commit cb3db64

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

src/level.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@ const getLevel = function({ opts, info }) {
2020
return defaultGetLevel(info)
2121
}
2222

23-
// TODO: remove `istanbul` comment once Windows is tested
24-
// istanbul ignore next
2523
const supportsUnicode = platform !== 'win32' || TERM === 'xterm-256color'
2624
// Each level is printed in a different way
27-
// istanbul ignore next
2825
const LEVELS = {
2926
debug: {
3027
COLOR: 'blue',

test/prettify.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ repeatEventsLevels((prefix, { eventName, emitEvent }, level) => {
2424
await emitEvent()
2525

2626
t.true(log.calledOnce)
27-
t.snapshot(log.lastCall.args[0])
27+
28+
// The first sign is OS-dependent, so we remove it
29+
const message = log.lastCall.args[0].replace(/[^ ]/u, '[]')
30+
t.snapshot(message)
2831

2932
stopLogging()
3033

test/snapshots/prettify.js.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,146 +8,146 @@ Generated by [AVA](https://ava.li).
88

99
> Snapshot 1
1010
11-
` multipleResolves (a promise was resolved/rejected multiple times) Initially resolved with: { success: true }␊
11+
` [] multipleResolves (a promise was resolved/rejected multiple times) Initially resolved with: { success: true }␊
1212
Then rejected with: Error: message␊
1313
at STACK TRACE`
1414

1515
## [multipleResolves] [error] should fire opts.getMessage() with a default prettifier
1616

1717
> Snapshot 1
1818
19-
` multipleResolves (a promise was resolved/rejected multiple times) Initially resolved with: { success: true }␊
19+
` [] multipleResolves (a promise was resolved/rejected multiple times) Initially resolved with: { success: true }␊
2020
Then rejected with: Error: message␊
2121
at STACK TRACE`
2222

2323
## [multipleResolves] [info] should fire opts.getMessage() with a default prettifier
2424

2525
> Snapshot 1
2626
27-
` multipleResolves (a promise was resolved/rejected multiple times) Initially resolved with: { success: true }␊
27+
` [] multipleResolves (a promise was resolved/rejected multiple times) Initially resolved with: { success: true }␊
2828
Then rejected with: Error: message␊
2929
at STACK TRACE`
3030

3131
## [multipleResolves] [warn] should fire opts.getMessage() with a default prettifier
3232

3333
> Snapshot 1
3434
35-
` multipleResolves (a promise was resolved/rejected multiple times) Initially resolved with: { success: true }␊
35+
` [] multipleResolves (a promise was resolved/rejected multiple times) Initially resolved with: { success: true }␊
3636
Then rejected with: Error: message␊
3737
at STACK TRACE`
3838

3939
## [rejectionHandled] [debug] should fire opts.getMessage() with a default prettifier
4040

4141
> Snapshot 1
4242
43-
` rejectionHandled (a promise was rejected and handled too late) Error: message␊
43+
` [] rejectionHandled (a promise was rejected and handled too late) Error: message␊
4444
at STACK TRACE`
4545

4646
## [rejectionHandled] [error] should fire opts.getMessage() with a default prettifier
4747

4848
> Snapshot 1
4949
50-
` rejectionHandled (a promise was rejected and handled too late) Error: message␊
50+
` [] rejectionHandled (a promise was rejected and handled too late) Error: message␊
5151
at STACK TRACE`
5252

5353
## [rejectionHandled] [info] should fire opts.getMessage() with a default prettifier
5454

5555
> Snapshot 1
5656
57-
` rejectionHandled (a promise was rejected and handled too late) Error: message␊
57+
` [] rejectionHandled (a promise was rejected and handled too late) Error: message␊
5858
at STACK TRACE`
5959

6060
## [rejectionHandled] [warn] should fire opts.getMessage() with a default prettifier
6161

6262
> Snapshot 1
6363
64-
` rejectionHandled (a promise was rejected and handled too late) Error: message␊
64+
` [] rejectionHandled (a promise was rejected and handled too late) Error: message␊
6565
at STACK TRACE`
6666

6767
## [uncaughtException] [debug] should fire opts.getMessage() with a default prettifier
6868

6969
> Snapshot 1
7070
71-
` uncaughtException (an exception was thrown but not caught) Error: message␊
71+
` [] uncaughtException (an exception was thrown but not caught) Error: message␊
7272
at STACK TRACE`
7373

7474
## [uncaughtException] [error] should fire opts.getMessage() with a default prettifier
7575

7676
> Snapshot 1
7777
78-
` uncaughtException (an exception was thrown but not caught) Error: message␊
78+
` [] uncaughtException (an exception was thrown but not caught) Error: message␊
7979
at STACK TRACE`
8080

8181
## [uncaughtException] [info] should fire opts.getMessage() with a default prettifier
8282

8383
> Snapshot 1
8484
85-
` uncaughtException (an exception was thrown but not caught) Error: message␊
85+
` [] uncaughtException (an exception was thrown but not caught) Error: message␊
8686
at STACK TRACE`
8787

8888
## [uncaughtException] [warn] should fire opts.getMessage() with a default prettifier
8989

9090
> Snapshot 1
9191
92-
` uncaughtException (an exception was thrown but not caught) Error: message␊
92+
` [] uncaughtException (an exception was thrown but not caught) Error: message␊
9393
at STACK TRACE`
9494

9595
## [unhandledRejection] [debug] should fire opts.getMessage() with a default prettifier
9696

9797
> Snapshot 1
9898
99-
` unhandledRejection (a promise was rejected but not handled) Error: message␊
99+
` [] unhandledRejection (a promise was rejected but not handled) Error: message␊
100100
at STACK TRACE`
101101

102102
## [unhandledRejection] [error] should fire opts.getMessage() with a default prettifier
103103

104104
> Snapshot 1
105105
106-
` unhandledRejection (a promise was rejected but not handled) Error: message␊
106+
` [] unhandledRejection (a promise was rejected but not handled) Error: message␊
107107
at STACK TRACE`
108108

109109
## [unhandledRejection] [info] should fire opts.getMessage() with a default prettifier
110110

111111
> Snapshot 1
112112
113-
` unhandledRejection (a promise was rejected but not handled) Error: message␊
113+
` [] unhandledRejection (a promise was rejected but not handled) Error: message␊
114114
at STACK TRACE`
115115

116116
## [unhandledRejection] [warn] should fire opts.getMessage() with a default prettifier
117117

118118
> Snapshot 1
119119
120-
` unhandledRejection (a promise was rejected but not handled) Error: message␊
120+
` [] unhandledRejection (a promise was rejected but not handled) Error: message␊
121121
at STACK TRACE`
122122

123123
## [warning] [debug] should fire opts.getMessage() with a default prettifier
124124

125125
> Snapshot 1
126126
127-
` warning (500) Detail␊
127+
` [] warning (500) Detail␊
128128
Error: message␊
129129
at STACK TRACE`
130130

131131
## [warning] [error] should fire opts.getMessage() with a default prettifier
132132

133133
> Snapshot 1
134134
135-
` warning (500) Detail␊
135+
` [] warning (500) Detail␊
136136
Error: message␊
137137
at STACK TRACE`
138138

139139
## [warning] [info] should fire opts.getMessage() with a default prettifier
140140

141141
> Snapshot 1
142142
143-
` warning (500) Detail␊
143+
` [] warning (500) Detail␊
144144
Error: message␊
145145
at STACK TRACE`
146146

147147
## [warning] [warn] should fire opts.getMessage() with a default prettifier
148148

149149
> Snapshot 1
150150
151-
` warning (500) Detail␊
151+
` [] warning (500) Detail␊
152152
Error: message␊
153153
at STACK TRACE`

test/snapshots/prettify.js.snap

-67 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)