Skip to content

Commit 181ad6f

Browse files
authored
Update dependencies (#51)
1 parent 5ad6516 commit 181ad6f

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
node-version:
13-
- 21
13+
- 22
1414
- 20
1515
- 18
1616
steps:

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"node": ">=18"
2121
},
2222
"scripts": {
23-
"test": "xo && nyc ava && tsd"
23+
"test": "xo && c8 ava && tsd"
2424
},
2525
"files": [
2626
"index.js",
@@ -38,16 +38,16 @@
3838
"string"
3939
],
4040
"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"
4444
},
4545
"devDependencies": {
46-
"ava": "^5.3.1",
47-
"nyc": "^15.1.0",
46+
"ava": "^6.2.0",
47+
"c8": "^10.1.3",
4848
"outdent": "^0.8.0",
4949
"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"
5252
}
5353
}

test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@ test('main', t => {
6767
}, {
6868
message: errorMessageRegexWithFileName,
6969
});
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+
}
7084
});
7185

7286
test('throws exported error error', t => {

0 commit comments

Comments
 (0)