Repository navigation
test: cut two assertions that can't fail and stop pinning tinyswap's dist file names - #37
Conversation
tinylinkify's punctuation test compared two equal strings, so it stayed green with P()'s cache removed. tinyini's toJSON test asserted JSON.stringify's own output, which runs no tinyini code; the stringify() line above it covers the fix.
…le name The EXPORTS test pinned each sibling's export to ./dist/<subpath>.mjs, so writing an export as a conditions object turned it red with every import still resolving. It now checks the subpath is in the package's exports.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
tinyaml
tinyini
tinyjson5
tinylinkify
tinyswap
commit: |
There was a problem hiding this comment.
ℹ️ No P0 or P1 findings; one P2 test-coverage issue inline.
Approach: Removing ineffective assertions and decoupling export validation from dist filenames is sound, but the replacement check confuses key presence with subpath availability.
Reviewed changes across all three test files and their corresponding implementations; all 252 tests in the affected packages pass with CI=1.
tinyini: Removes the nativeJSON.stringifyassertion while retaining coverage of tinyini's key-sensitivetoJSONbehavior.tinylinkify: Removes the primitive-string equality assertion and retains the engine-punctuation check without claiming to verify caching.tinyswap: Allows different export target representations while retaining the source-export comparison, but now misses explicitly blocked subpaths.
gpt-6.1-sol(xhigh) | 𝕏
Latest result Pull request merged. Final answersSession Pull request merged. Ready under the review policy: all supplied checks pass and no P0/P1 remains. Reproduced the P2 null-export coverage gap and resolved its thread as declined because P2-only pushes are prohibited. No files changed. Local suites and lint were unavailable because host dependency installation failed with “Unsupported dependency source protocol”; hosted CI passed. |

Three assertions in the suite don't do their job. Two can never go red: tinylinkify's punctuation test compares two equal strings, so it stays green with
P()'s cache removed, and tinyini'stoJSONtest assertsJSON.stringify's own output, which runs no tinyini code. The third, in tinyswap, pins each sibling export to./dist/<subpath>.mjs. It goes red when an export is written as a conditions object, even though every import still resolves.This cuts the two assertions that can't fail. It also changes the tinyswap check to assert that the subpath is in the package's
exports, which still fails when a subpath goes missing. No test is deleted. I proved each change by breaking or refactoring the code and running only that test:tinylinkify/test/linkify-it.test.ts"reads punctuation from the engine, once",expect(a.re.src_P).toBe(b.re.src_P)if (punctuation) return punctuation;insrc/linkify-it/re.ts, soP()recomputes on every call: still green.tinyini/test/root.test.ts"skips what JSON skips, calls toJSON, …",expect(JSON.stringify({ a: key, … }))own()insrc/stringify.tspass""instead of the key and cut thestringify()line above it: still green. With that line back, the same break fails it (a=<a>vsa=<>), so the c17fc21 fix stays covered.tinyswap/test/libraries.test.ts"lists what %s exports",toBe(./dist/${subpath}.mjs)"./js-yaml"export as{ types, default }pointing at the same file: red. The rewrite stays green on that refactor and goes red when"./js-yaml"is dropped fromexports.Test counts: 1166 before and after (tinyaml 809, tinyswap 153, tinyjson5 105, tinyini 63, tinylinkify 36), with 9 skipped and none failing. I ran each package's suite on Linux with
CI=1and the fixtures CI fetches. I reran tinyswap, tinylinkify and tinyini after the change. tinyaml and tinyjson5 have no changes, so I didn't rerun them.Kept on purpose:
js-yaml/load.test.ts"keeps a key a custom type constructs as undefined"). They don't touch tinyaml, but they go red when a dev dependency bump changes the behavior the drop-in claims to match.remarkGithubandlinkifyItGithub. They only measure the dependencies, but they keep the README table honest.doctor.test.ts"is told apart by each rule's version in the build" and the built-entry check inmessages.test.ts. Both read build internals, but both came in with fixes (ed604d1, 7332668) and no other test catches those bugs.yaml/stringify.test.ts"reads an option set to undefined over its default": theTypeErrorcheck fornullStr: undefinedcame in with 7332668. The loop above only checks that tinyaml and yaml agree, and this line checks that the call really throws.pollutedchecks in tinyini, tinyjson5 and tinyaml are security tests, not tombstones.same()/agree()helpers, or in acatchafterexpect.unreachable().I didn't run the 9 skipped tests. Seven tinyjson5 tests need
.cache/json5-main, which CI never fetches (ci.ymlrunscorpus:fetchandjson5:fetchbut notjson5:main:fetch), so they skip on CI too. One tinyini one-ini test needs cmake, and tinyaml's "runs as the bin npm links" test only runs undertest:dist. P()'s cache now has no test; only timing shows it to a caller.