Skip to content

webrun-modules: two proxy tests do not verify what their names claim #4

Description

@mkotelnikov

Both found during review of #1. Neither is a bug in shipped code — both are tests that would stay green through a real regression.

1. tests/proxy-accumulation.test.ts — "does not rewrite when a later importer adds nothing"

It asserts the emitted body is byte-identical after a second ensureProxy call that adds no names. But a redundant re-emit produces byte-identical content too, so the assertion cannot distinguish "skipped the write" from "wrote the same bytes again". A reviewer confirmed this empirically: disabling the entire if (!firstTouch && !grew && exists) return guard leaves the test passing.

To actually test the skip, count writes — e.g. a FilesApi wrapper that tallies write calls for that path.

2. tests/deps-proxy-server.test.ts — "class-as-adapter-key: two importers share one root proxy…"

The name claims it proves shape merging, but both importers use an identical import shape (import { K }), so it would pass under first-write-wins as well. It really only proves the shared root path exists.

The merging property IS genuinely covered — by its sibling React test, where export default __m comes only from a.ts and export const useState only from b.ts, so either write order without accumulation drops one. So this is a naming/coverage-clarity fix, not a hole.

🤖 Filed with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions