File tree Expand file tree Collapse file tree 3 files changed +23
-9
lines changed Expand file tree Collapse file tree 3 files changed +23
-9
lines changed Original file line number Diff line number Diff line change 10
10
fail-fast : false
11
11
matrix :
12
12
node-version :
13
- - 21
13
+ - 22
14
14
- 20
15
15
- 18
16
16
steps :
Original file line number Diff line number Diff line change 20
20
"node" : " >=18"
21
21
},
22
22
"scripts" : {
23
- "test" : " xo && nyc ava && tsd"
23
+ "test" : " xo && c8 ava && tsd"
24
24
},
25
25
"files" : [
26
26
" index.js" ,
38
38
" string"
39
39
],
40
40
"dependencies" : {
41
- "@babel/code-frame" : " ^7.22.13 " ,
42
- "index-to-position" : " ^0.1.2 " ,
43
- "type-fest" : " ^4.7.1 "
41
+ "@babel/code-frame" : " ^7.26.2 " ,
42
+ "index-to-position" : " ^1.0.0 " ,
43
+ "type-fest" : " ^4.37.0 "
44
44
},
45
45
"devDependencies" : {
46
- "ava" : " ^5.3.1 " ,
47
- "nyc " : " ^15 .1.0 " ,
46
+ "ava" : " ^6.2.0 " ,
47
+ "c8 " : " ^10 .1.3 " ,
48
48
"outdent" : " ^0.8.0" ,
49
49
"strip-ansi" : " ^7.1.0" ,
50
- "tsd" : " ^0.29.0 " ,
51
- "xo" : " ^0.56 .0"
50
+ "tsd" : " ^0.31.2 " ,
51
+ "xo" : " ^0.60 .0"
52
52
}
53
53
}
Original file line number Diff line number Diff line change @@ -67,6 +67,20 @@ test('main', t => {
67
67
} , {
68
68
message : errorMessageRegexWithFileName ,
69
69
} ) ;
70
+
71
+ {
72
+ let jsonError ;
73
+ try {
74
+ parseJson ( INVALID_JSON_STRING , 'foo.json' ) ;
75
+ } catch ( error ) {
76
+ jsonError = error ;
77
+ }
78
+
79
+ jsonError . message = 'custom error message' ;
80
+ t . true ( jsonError . message . startsWith ( 'custom error message in foo.json' ) ) ;
81
+ // Still have code from in message.
82
+ t . true ( stripAnsi ( jsonError . message ) . includes ( '> 3 | }' ) ) ;
83
+ }
70
84
} ) ;
71
85
72
86
test ( 'throws exported error error' , t => {
You can’t perform that action at this time.
0 commit comments