Skip to content

Commit 1301dba

Browse files
committed
fix: add node check for emoji test | fixed escaping of backslash
1 parent c4fdda3 commit 1301dba

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/rules/no-missing-link-fragments.test.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ ruleTester.run("no-missing-link-fragments", rule, {
139139

140140
// Headings with inline Markdown formatting
141141
dedent`
142-
# Heading with \`inline code\`
142+
# Heading with \\\`inline code\\\`
143143
[Link](#heading-with-inline-code)
144144
145145
# Heading with *italic text*
@@ -159,21 +159,27 @@ ruleTester.run("no-missing-link-fragments", rule, {
159159
`,
160160

161161
// Headings with emojis and accented characters
162-
dedent`
162+
// This test case is skipped for non-Node environments like Bun
163+
...(typeof process !== "undefined" && process.release.name === "node"
164+
? [
165+
dedent`
163166
# Heading with 🚀 emoji
164167
[Link](#heading-with--emoji)
165168
166169
# Héading with àccènt chàrâctérs
167170
[Link](#héading-with-àccènt-chàrâctérs)
168171
169-
# Mix: _Héading_ with 🚀 & \`code\`
172+
# Mix: _Héading_ with 🚀 & \\\`code\\\`
170173
[Link](#mix-héading-with---code)
171174
`,
175+
]
176+
: []),
172177

173178
{
174-
code: '<div id="HtmlCaseCheck"></div>\n[Link](#htmlcasecheck)',
179+
code: '<div id="HtmlCaseCheck"></div>\\n[Link](#htmlcasecheck)',
175180
options: [{ ignoreCase: true }],
176181
},
182+
177183
// Valid: HTML ID inside comment is ignored, link to valid ID still works
178184
dedent`
179185
<!-- <div id="commented-out"></div> -->

0 commit comments

Comments
 (0)