Skip to content

Commit

Permalink
don't test emoji in filenames on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mceachen committed Sep 30, 2023
1 parent 8c76df0 commit c2eb83c
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/_chai.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,23 +113,17 @@ export function assertEqlDateish(
return expect(dateishToExifString(a)).to.eql(dateishToExifString(b))
}

const nodeMajorVersion = parseInt(process.version.replace(/[^\d.]/, ""))

const winAndGteNode20 = isWin32() && nodeMajorVersion >= 20

export const NonAlphaStrings = compact([
{ str: `'`, desc: "straight single quote" },
// windows doesn't support double-quotes in filenames (!!)
isWin32() ? undefined : { str: `"`, desc: "straight double quote" },
{ str: `‘’“”«»`, desc: "curly quotes" },
{ str: "ñöᵽȅ", desc: "latin extended" },
{ str: "✋", desc: "dingbats block" },
// This results in a spurious Error: File not found -
// C:/Users/RUNNER~1/AppData/Local/Temp/tmp-6316-4LyVb3QgsXPL/src-😤/😤.jpg
// but only on node 20 on windows. node 18 and 16 pass, so this is a
// regression in Node.js (!!)
winAndGteNode20 ? undefined : { str: "😤", desc: "emoticons block" },
winAndGteNode20 ? undefined : { str: "🚵🏿‍♀", desc: "transport block" },
// These emoji tests fail on node 18.18+ and node 20 on Windows, but it's a
// bug in node, as it passes on macOS and Linux.
isWin32() ? undefined : { str: "😤", desc: "emoticons block" },
isWin32() ? undefined : { str: "🚵🏿‍♀", desc: "transport block" },
{ str: "你好", desc: "Mandarin" },
{ str: "ようこそ", desc: "Japanese" },
{ str: "ברוך הבא", desc: "Hebrew" },
Expand Down

0 comments on commit c2eb83c

Please sign in to comment.