Repository navigation
feat: add reusable fixture modules and atomic reloads - #590
AnshulBhati01 wants to merge 1 commit into
Conversation
commit: |
|
Hey, really appreciate you putting this together. It's a lot of work and it's clear you thought hard about the reload semantics. We're going to pass on it though. The biggest thing is reach: it's only usable from the TypeScript API, and folks in code can already compose fixtures however they like. The people who'd actually want reusable JSON fixture sets are running aimock from the CLI, a config file, or Docker, and this doesn't get to them. A couple of things also bit us when we tried it. Mounting, reloading, or unmounting a module rebuilds the fixture list and drops anything record mode added at runtime, so the next matching request goes upstream again. And there's no cap on include expansion, so a short chain of files that each include the next one twice locked up the event loop for about 44 seconds. If reusable fixture sets matter to you, I'd love to work out a version that starts from the CLI and config side. Open an issue with a sketch and let's go from there. Thanks again. |
Reusable fixture sets currently have to be flattened before loading, and replacing a group of related fixtures can expose a partially updated queue. This adds JSON fixture modules with explicit parameters, relative includes and bounded expansion, plus named mounts that retain their position and reload affected dependencies atomically.
loadFixtureModuleloads a snapshot;mountFixtureModule,reloadFixtureModules,unmountFixtureModuleandgetFixtureModulesmanage named registrations. Reload validates the complete selected set before publishing. Existing live-fixture validation, misbehavior opt-in and fixture queue updates are preserved. Usage and limits are documented indocs/fixture-modules.md.Validation: 223 focused tests pass, including 119 module/lifecycle cases. Type checks, ESLint, formatting, build, generated API reports and package export checks pass. A full-suite run passed 19,540 tests; after building the CLI artifacts, rerunning its affected files passed 887 tests with one remaining A9 witness failure requiring 2 GiB free memory. That same memory failure reproduces on the unchanged upstream checkout.
This adds public APIs; the generated
etc/reports are included. Please apply thepublic-api-additionlabel for the repository's compatibility review gate.