Skip to content

test(transformers): restore 1:1 spec convention for luxon/moment - #42

Merged
parkrevil merged 1 commit into
mainfrom
fix/restore-1to1-transformer-specs
Jun 22, 2026
Merged

test(transformers): restore 1:1 spec convention for luxon/moment#42
parkrevil merged 1 commit into
mainfrom
fix/restore-1to1-transformer-specs

Conversation

@parkrevil

Copy link
Copy Markdown
Contributor

Cleanup of #41. That PR added separate luxon.notfound/.evalerror + moment.* spec files and forced --isolate to execute the peer-dep load-failure catch — violating the project's 1:1 source↔spec convention.

The branch is fundamentally untestable in a 1:1 file: luxon/moment are installed devDependencies, so the happy-path spec uses the real module and a throwing mock.module cannot coexist with it in one bun process (the existing luxon.spec.ts comment already documented this).

This reverts to the project's established pattern: 1:1 specs, peer-dep branch left untested-by-design (documented in-code), kept under the per-file coverage gate. The catch keeps the ERR_MODULE_NOT_FOUND narrowing as a single ternary throw — the only form satisfying all of: oxlint curly (no brace-less if), the 90% per-file gate (one uncovered line), and 1:1 (no separate test file). Identical to the form shipped in 5.2.0.

Removes the 4 extra spec files + --isolate. No runtime change (no changeset).

Gates: typecheck, build, test (2469/0), test:coverage (all ≥90%, luxon 97% / moment 96%), memory, lint (0/0), deps, knip — green.

🤖 Generated with Claude Code

…peer-dep tests

#41 added separate luxon.notfound/.evalerror + moment.* spec files and forced
`--isolate` to genuinely execute the peer-dep load-failure catch. That broke the
project's 1:1 source↔spec convention. The branch is fundamentally untestable in a
1:1 file: luxon/moment are installed devDependencies, so the happy-path spec uses
the real module and a throwing mock.module cannot coexist with it in one bun
process (the original luxon.spec.ts comment already noted this).

Revert to the project's established pattern: 1:1 specs, the peer-dep branch left
untested-by-design (documented in-code), kept under the per-file coverage gate. The
catch keeps the ERR_MODULE_NOT_FOUND narrowing as a single ternary throw — the only
form that satisfies all of: oxlint `curly` (no brace-less if), the 90% per-file gate
(one uncovered line), and 1:1 (no separate test file). Identical to the form shipped
in 5.2.0. Removes the four extra spec files and the `--isolate` flag. No runtime change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@parkrevil
parkrevil merged commit 6a2a74f into main Jun 22, 2026
1 check passed
@parkrevil
parkrevil deleted the fix/restore-1to1-transformer-specs branch June 22, 2026 05:15
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