Repository navigation
feat: verify request completion dependencies - #592
AnshulBhati01 wants to merge 1 commit into
Conversation
commit: |
|
Thanks a lot for this. The implementation is careful and the tests are genuinely good, which made this a harder call. We're going to pass on it. Checking ordering between dependent calls is a pretty narrow need for most aimock users, and it brings a lot of new public API with it. It also adds a bit of work to every request even when nobody's registered an expectation. And causal mode gets expensive as traffic grows: 16k requests took about 55 seconds and blocked the server while it ran, and prerequisite matching blows up quickly (one request took ~555ms with five prerequisites). I think there's a lighter version that gets most of the value: record start and completion times on journal entries, and let tests check ordering themselves. If you're up for that, I'd happily take a small PR for it. Thanks again for the effort here. |
Request counts alone cannot show whether a dependent call started before its prerequisites finished. This adds per-test-ID request expectations with completion barriers (
after), consumable prerequisite occurrences (afterEach) and optional causal/correlation grouping.verifyRequests()reports started, completed, aborted, pending, missing, excess and premature requests without blocking or changing the response. Expectations are validated before replacement; resets detach in-flight observations from the new state. Control and system routes are excluded. Seedocs/request-verification.mdfor examples.Validation: 453 tests pass across the dependency, journal, server, control, LLMock and test-ID isolation suites. Type checks, build, ESLint, formatting and package export checks pass. Generated API reports are included; please apply
public-api-additionfor compatibility review.