Skip to content

Use native paths in the standard font cache test - #1884

Merged
blikblum merged 1 commit into
foliojs:masterfrom
xmsnmo444:fix/windows-standard-font-cache-check
Nov 28, 2026
Merged

blikblum merged 1 commit into
foliojs:masterfrom
xmsnmo444:fix/windows-standard-font-cache-check

Conversation

@xmsnmo444

Copy link
Copy Markdown
Contributor

On Windows, yarn test:package fails after drawing with Helvetica. The font is in require.cache under a native path such as …\js\standard-fonts\Helvetica.cjs, so the filter looking for js/standard-fonts returns an empty list.

Resolve the generated standard-font directory relative to the test module and match its native path prefix, including the trailing separator. The checks still verify that no standard fonts are initially loaded and that drawing with Helvetica does not load Courier or Times Roman.

Verified the original failure on Windows from master. The CommonJS and ESM package-resolution tests pass with this change on both Windows and Linux (WSL), using Node 24.21.0.

OpenAI Codex found the test failure while checking a separate change, prepared this fix, and ran the tests.

@blikblum
blikblum merged commit fda00eb into foliojs:master Nov 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants