Skip to content

fix(subpath): use fileURLToPath for cross-platform PROJECT_ROOT; document test idioms#19

Merged
the-simian merged 1 commit into
mainfrom
experiment/ai-findings-response
Apr 24, 2026
Merged

fix(subpath): use fileURLToPath for cross-platform PROJECT_ROOT; document test idioms#19
the-simian merged 1 commit into
mainfrom
experiment/ai-findings-response

Conversation

@the-simian

@the-simian the-simian commented Apr 24, 2026

Copy link
Copy Markdown
Member

Four small changes to the subpath-exports test and one to the changelog.

Changes

  • test/subpathExports.test.ts — derive PROJECT_ROOT via fileURLToPath(new URL('../', import.meta.url)) instead of .pathname. The .pathname form produces invalid Windows paths like /C:/...; fileURLToPath handles the conversion correctly.
  • test/subpathExports.test.ts — add a three-line comment above the 'PANTONE' as never assertion explaining that the cast is intentional. It asserts both runtime-absence AND compile-time-unassignability to the narrow ColorFormat union; removing the cast would weaken the test to runtime-only.
  • test/subpathExports.test.ts — add a four-line comment above the execFileSync call explaining why it isn't wrapped in try/catch. Node attaches .stdout and .stderr to 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 #E20074 to #e20074 on line 90 to match the rest of the changelog. Both forms are hex-color literals that semantic-release auto-linkified as issue references in an older release section.

Tests

471/471 passing locally; 100% coverage held. test: scope; semantic-release will not cut a release.

@codecov

codecov Bot commented Apr 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (028c065) to head (436fabc).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #19   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           30        30           
  Lines         9839      9839           
=========================================
  Hits          9839      9839           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@the-simian the-simian changed the title test(subpath): address GitHub AI Code Quality findings (experiment) test(subpath): fix cross-platform PROJECT_ROOT and document test idioms Apr 24, 2026
…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.
@the-simian the-simian force-pushed the experiment/ai-findings-response branch from a5d5c88 to 436fabc Compare April 24, 2026 00:53
@the-simian the-simian changed the title test(subpath): fix cross-platform PROJECT_ROOT and document test idioms fix(subpath): use fileURLToPath for cross-platform PROJECT_ROOT; document test idioms Apr 24, 2026
@the-simian the-simian merged commit 4306543 into main Apr 24, 2026
8 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.

1 participant