Repository navigation
test(filler): share one mock module loader across the handler tests - #239
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
🟢 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
createMockModuleLoaderhelper. - 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.
Merged
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.
Each of 25 handler test files under
src/filler/handlersdefined its owncreateMockModuleLoader(), andsrc/filler/handlers/test-helper.tsheld 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
ModuleLoadertype import left each file that used it only for the copy. No test observes a different value.Validation.
pnpm check-typesandpnpm lintpass.pnpm testpasses 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.mdentry: the change touches test files only.