fix(subpath): use fileURLToPath for cross-platform PROJECT_ROOT; document test idioms#19
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #19 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 30 30
Lines 9839 9839
=========================================
Hits 9839 9839 🚀 New features to boost your workflow:
|
…ment test idioms
Addresses findings from GitHub's AI Code Quality review:
1. test/subpathExports.test.ts: derive PROJECT_ROOT via
fileURLToPath(new URL('../', import.meta.url)) instead of
.pathname. The .pathname form produces Windows-invalid paths
like /C:/... and would break the subpath-export tests on any
Windows runner.
2. test/subpathExports.test.ts: add a comment above the
'PANTONE' as never assertion explaining the cast is intentional.
It asserts BOTH runtime-absence AND compile-time-unassignability
to the narrow ColorFormat union.
3. test/subpathExports.test.ts: add a comment above the
execFileSync call explaining why it isn't wrapped in try/catch.
Node attaches .stdout and .stderr to the thrown error; Bun's
test runner surfaces them in the failure report.
4. CHANGELOG.md: lowercase #E20074 to #e20074 on line 90 to match
the rest of the changelog. Both forms are hex colors that
semantic-release auto-linkified as issue refs.
Tests: 471/471 passing, 100% coverage held.
a5d5c88 to
436fabc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four small changes to the subpath-exports test and one to the changelog.
Changes
test/subpathExports.test.ts— derivePROJECT_ROOTviafileURLToPath(new URL('../', import.meta.url))instead of.pathname. The.pathnameform produces invalid Windows paths like/C:/...;fileURLToPathhandles the conversion correctly.test/subpathExports.test.ts— add a three-line comment above the'PANTONE' as neverassertion explaining that the cast is intentional. It asserts both runtime-absence AND compile-time-unassignability to the narrowColorFormatunion; removing the cast would weaken the test to runtime-only.test/subpathExports.test.ts— add a four-line comment above theexecFileSynccall explaining why it isn't wrapped in try/catch. Node attaches.stdoutand.stderrto the thrown error, and Bun's test runner surfaces them in the failure report; the two failure modes (broken exports map vs. subprocess execution error) are already distinguishable.CHANGELOG.md— lowercase#E20074to#e20074on line 90 to match the rest of the changelog. Both forms are hex-color literals thatsemantic-releaseauto-linkified as issue references in an older release section.Tests
471/471 passing locally; 100% coverage held.
test:scope;semantic-releasewill not cut a release.