Skip to content

test: cut two assertions that can't fail and stop pinning tinyswap's dist file names - #37

Merged
vite-hub[bot] merged 2 commits into
mainfrom
test/prune-r2-tiny
Nov 17, 2026
Merged

vite-hub[bot] merged 2 commits into
mainfrom
test/prune-r2-tiny

Conversation

@onmax

@onmax onmax commented Nov 17, 2026

Copy link
Copy Markdown
Owner

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's toJSON test asserts JSON.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:

Test Kind Proof Action
tinylinkify/test/linkify-it.test.ts "reads punctuation from the engine, once", expect(a.re.src_P).toBe(b.re.src_P) can't fail Deleted if (punctuation) return punctuation; in src/linkify-it/re.ts, so P() recomputes on every call: still green. line cut, test renamed to "reads punctuation from the engine"
tinyini/test/root.test.ts "skips what JSON skips, calls toJSON, …", expect(JSON.stringify({ a: key, … })) can't fail Made own() in src/stringify.ts pass "" instead of the key and cut the stringify() line above it: still green. With that line back, the same break fails it (a=<a> vs a=<>), so the c17fc21 fix stays covered. line cut
tinyswap/test/libraries.test.ts "lists what %s exports", toBe(./dist/${subpath}.mjs) change detector Wrote tinyaml's "./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 from exports. rewritten

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=1 and 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:

  • The "as js-yaml / yaml / yamljs / std does" tests that also assert the reference library (for example 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.
  • tinylinkify's GFM fixture scores remarkGithub and linkifyItGithub. 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 in messages.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": the TypeError check for nullStr: undefined came in with 7332668. The loop above only checks that tinyaml and yaml agree, and this line checks that the call really throws.
  • The polluted checks in tinyini, tinyjson5 and tinyaml are security tests, not tombstones.
  • The lint hits for "no assertions" and "conditional expect" in tinyaml's std, yaml and yamljs tests are false positives: those tests assert through same() / agree() helpers, or in a catch after expect.unreachable().

I didn't run the 9 skipped tests. Seven tinyjson5 tests need .cache/json5-main, which CI never fetches (ci.yml runs corpus:fetch and json5:fetch but not json5: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 under test:dist. P()'s cache now has no test; only timing shows it to a caller.

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.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T22:35:40.346032Z
We couldn’t complete this review. Comment @codex review to try again.
8bf530f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

tinyaml

pnpm add https://pkg.pr.new/onmax/tiny/tinyaml@37

tinyini

pnpm add https://pkg.pr.new/onmax/tiny/tinyini@37

tinyjson5

pnpm add https://pkg.pr.new/onmax/tiny/tinyjson5@37

tinylinkify

pnpm add https://pkg.pr.new/onmax/tiny/tinylinkify@37

tinyswap

pnpm add https://pkg.pr.new/onmax/tiny/tinyswap@37

commit: 8bf530f

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ 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 native JSON.stringify assertion while retaining coverage of tinyini's key-sensitive toJSON behavior.
  • 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.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

@vite-hub

vite-hub Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Completed 2026-11-17T23:03:53.545Z 3m 32s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

View session

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.

@vite-hub
vite-hub Bot merged commit 0be5a74 into main Nov 17, 2026
10 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 17, 2026
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