Skip to content

test(filler): share one mock module loader across the handler tests - #239

Merged
robrigo merged 1 commit into
mainfrom
refactor/eng-1315-shared-mock-module-loader
Oct 8, 2026
Merged

robrigo merged 1 commit into
mainfrom
refactor/eng-1315-shared-mock-module-loader

Conversation

@robrigo

@robrigo robrigo commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Each of 25 handler test files under src/filler/handlers defined its own createMockModuleLoader(), and src/filler/handlers/test-helper.ts held one more copy that it did not export. A change to the loader had to land in 26 places. Tracking: ENG-1315. Lane S.

The helper now exports the loader, and each test file imports it in place of its copy. Before the edit, the 26 function bodies were compared with white space and comment lines removed, and all 26 gave the same hash, so no file needed a parameter. The ModuleLoader type import left each file that used it only for the copy. No test observes a different value.

Validation. pnpm check-types and pnpm lint pass. pnpm test passes with 596 tests and 37 pending, the same counts as before. 22 of the 25 changed files are integration tests, which did not run locally, so the integration jobs of this PR prove them.

No CHANGELOG.md entry: the change touches test files only.

Each of 25 handler test files defined its own copy of the mock module
loader, and the handler test helper held one more copy that it did
not export. All 26 bodies were the same, so a change to the loader
had to land in 26 places.

The helper now exports the loader and the test files import it. No
test observes a different value.

Signed-off-by: Rob Konsdorf <rob@facings.io>

Copilot AI 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.

🟢 Approval recommended

This test-only refactor preserves the existing factory behavior and has no unresolved blocking findings.

0 open findings

What changed in this PR

Centralizes the mock module loader used by handler tests, removing duplication without changing production code or test behavior.

Changes:

  • Exports the existing createMockModuleLoader helper.
  • Replaces 25 local copies with shared imports.
  • Removes imports needed only by the deleted copies.
File Description
src/​filler/​handlers/​test-helper.ts Exports the shared loader factory.
src/​filler/​handlers/​simpleassets/​snapshot-import.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​simpleassets/​processors/​bridge.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​simpleassets/​processors/​authors.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​simpleassets/​processors/​assets.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicpacksx/​processors/​rolls.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicpacksx/​processors/​packs.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicpacksx/​processors/​claims.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicmarket/​processors/​sales.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicmarket/​processors/​sales.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicmarket/​processors/​royalties.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicmarket/​processors/​config.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicmarket/​processors/​buyoffers.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicmarket/​processors/​buyoffers.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicmarket/​processors/​auctions.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicmarket/​processors/​auctions.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicdropsx/​processors/​drops.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicdropsx/​processors/​claims.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicassets/​processors/​templates.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicassets/​processors/​schemas.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicassets/​processors/​offers.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicassets/​processors/​logs.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicassets/​processors/​config.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicassets/​processors/​collections.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicassets/​processors/​assets.integration.test.ts Uses the shared loader.
src/​filler/​handlers/​atomicassets/​float-repair.integration.test.ts Uses the shared loader.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@robrigo
robrigo merged commit b9f2c18 into main Oct 8, 2026
8 checks passed
@robrigo
robrigo deleted the refactor/eng-1315-shared-mock-module-loader branch October 8, 2026 19:28
@robrigo robrigo mentioned this pull request Oct 8, 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.

2 participants