1- const test = require ( "node:test" )
1+ const { test } = require ( "node:test" )
22const assert = require ( "node:assert/strict" )
33
44const { markdownlint } = require ( "markdownlint" ) . promises
@@ -14,33 +14,33 @@ test("ensure the rule validate correctly", async () => {
1414 } ,
1515 customRules : [ relativeLinks ] ,
1616 } )
17- assert . equal ( lintResults [ "test/fixtures/Valid.md" ] . length , 0 )
18- assert . equal ( lintResults [ "test/fixtures/Invalid.md" ] . length , 3 )
17+ assert . equal ( lintResults [ "test/fixtures/Valid.md" ] ? .length , 0 )
18+ assert . equal ( lintResults [ "test/fixtures/Invalid.md" ] ? .length , 3 )
1919
2020 assert . equal (
21- lintResults [ "test/fixtures/Invalid.md" ] [ 0 ] ?. ruleDescription ,
21+ lintResults [ "test/fixtures/Invalid.md" ] ?. [ 0 ] ?. ruleDescription ,
2222 "Relative links should be valid" ,
2323 )
2424 assert . equal (
25- lintResults [ "test/fixtures/Invalid.md" ] [ 0 ] ?. errorDetail ,
26- 'Link "./basic.test.js" should exist in the file system' ,
25+ lintResults [ "test/fixtures/Invalid.md" ] ?. [ 0 ] ?. errorDetail ,
26+ '"./basic.test.js" should exist in the file system' ,
2727 )
2828
2929 assert . equal (
30- lintResults [ "test/fixtures/Invalid.md" ] [ 1 ] ?. ruleDescription ,
30+ lintResults [ "test/fixtures/Invalid.md" ] ?. [ 1 ] ?. ruleDescription ,
3131 "Relative links should be valid" ,
3232 )
3333 assert . equal (
34- lintResults [ "test/fixtures/Invalid.md" ] [ 1 ] ?. errorDetail ,
35- 'Link "../image.png" should exist in the file system' ,
34+ lintResults [ "test/fixtures/Invalid.md" ] ?. [ 1 ] ?. errorDetail ,
35+ '"../image.png" should exist in the file system' ,
3636 )
3737
3838 assert . equal (
39- lintResults [ "test/fixtures/Invalid.md" ] [ 2 ] ?. ruleDescription ,
39+ lintResults [ "test/fixtures/Invalid.md" ] ?. [ 2 ] ?. ruleDescription ,
4040 "Relative links should be valid" ,
4141 )
4242 assert . equal (
43- lintResults [ "test/fixtures/Invalid.md" ] [ 2 ] ?. errorDetail ,
44- 'Link "./Valid.md#not-existing-heading" should have a valid fragment' ,
43+ lintResults [ "test/fixtures/Invalid.md" ] ?. [ 2 ] ?. errorDetail ,
44+ '"./Valid.md#not-existing-heading" should have a valid fragment identifier ' ,
4545 )
4646} )
0 commit comments