@@ -22,7 +22,12 @@ describe("Test the constructor of Link", () => {
22
22
testLink . originFiles ,
23
23
testLink . isExternal ,
24
24
] ;
25
- const correct_values = [ "/testpath" , "" , [ "/testorigin.mdx" ] , false ] ;
25
+ const correct_values = [
26
+ "/testpath" ,
27
+ "" ,
28
+ new Set ( [ "/testorigin.mdx" ] ) ,
29
+ false ,
30
+ ] ;
26
31
expect ( attributes ) . toEqual ( correct_values ) ;
27
32
} ) ;
28
33
@@ -37,7 +42,7 @@ describe("Test the constructor of Link", () => {
37
42
const correct_values = [
38
43
"/testpath" ,
39
44
"#testanchor" ,
40
- [ "/testorigin.mdx" ] ,
45
+ new Set ( [ "/testorigin.mdx" ] ) ,
41
46
false ,
42
47
] ;
43
48
expect ( attributes ) . toEqual ( correct_values ) ;
@@ -54,7 +59,7 @@ describe("Test the constructor of Link", () => {
54
59
const correct_values = [
55
60
"https://test.link.com" ,
56
61
"" ,
57
- [ "/testorigin.mdx" ] ,
62
+ new Set ( [ "/testorigin.mdx" ] ) ,
58
63
true ,
59
64
] ;
60
65
expect ( attributes ) . toEqual ( correct_values ) ;
@@ -129,6 +134,8 @@ describe("Validate links", () => {
129
134
let testLink = new Link ( "../testpath" , [
130
135
"docs/test/testorigin.mdx" ,
131
136
"docs/test/test2/testorigin.mdx" ,
137
+ // Duplicate of the above value to confirm we de-duplicate originFiles.
138
+ "docs/test/test2/testorigin.mdx" ,
132
139
"docs/test/test3/testorigin.mdx" ,
133
140
"docs/test/test2/test4/testorigin.mdx" ,
134
141
] ) ;
0 commit comments