test(transformers): restore 1:1 spec convention for luxon/moment - #42
Merged
Conversation
…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>
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.
Cleanup of #41. That PR added separate
luxon.notfound/.evalerror+moment.*spec files and forced--isolateto execute the peer-dep load-failurecatch— 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.modulecannot coexist with it in one bun process (the existingluxon.spec.tscomment 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
catchkeeps theERR_MODULE_NOT_FOUNDnarrowing as a single ternary throw — the only form satisfying all of: oxlintcurly(no brace-lessif), 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