Repository navigation
fix(domain): Verify answers a stubbed call with an instance of its class - #3898
Open
creatifcoding wants to merge 1 commit into
Open
creatifcoding wants to merge 1 commit into
creatifcoding wants to merge 1 commit into
Conversation
Contributor
|
Install the packages built from this commit: alchemypnpm install https://pkg.alchemy.run/alchemy/pr:3898:536e743@alchemy.run (21)pnpm install https://pkg.alchemy.run/@alchemy.run/better-auth/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/git/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/drizzle/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/acme/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/planetscale/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/neon/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/hetzner/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/railway/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/fly/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/gcp/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/aws/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/domain/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/kubernetes/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/docker/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/redis/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/sql/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare-runtime/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/node-utils/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/pkg/pr:3898:536e743Transitive Dependencies (17)pnpm install https://pkg.alchemy.run/@distilled.cloud/aws/pr:3898:536e743pnpm install https://pkg.alchemy.run/@distilled.cloud/acme/pr:3898:536e743pnpm install https://pkg.alchemy.run/@distilled.cloud/core/pr:3898:536e743pnpm install https://pkg.alchemy.run/@distilled.cloud/planetscale/pr:3898:536e743pnpm install https://pkg.alchemy.run/@distilled.cloud/neon/pr:3898:536e743pnpm install https://pkg.alchemy.run/@distilled.cloud/s3/pr:3898:536e743pnpm install https://pkg.alchemy.run/@distilled.cloud/hetzner/pr:3898:536e743pnpm install https://pkg.alchemy.run/@distilled.cloud/railway/pr:3898:536e743pnpm install https://pkg.alchemy.run/@distilled.cloud/fly-io/pr:3898:536e743pnpm install https://pkg.alchemy.run/@distilled.cloud/github/pr:3898:536e743pnpm install https://pkg.alchemy.run/@distilled.cloud/aws4signer/pr:3898:536e743pnpm install https://pkg.alchemy.run/@distilled.cloud/cloudflare/pr:3898:536e743pnpm install https://pkg.alchemy.run/@distilled.cloud/iceberg/pr:3898:536e743pnpm install https://pkg.alchemy.run/@distilled.cloud/gcp/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/effect-cluster/pr:3898:536e743pnpm install https://pkg.alchemy.run/@alchemy.run/rivet/pr:3898:536e743pnpm install https://pkg.alchemy.run/@distilled.cloud/rivet/pr:3898:536e743Published |
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.
Verify.modelnow runs a sequence whose external system answers with a class as a passing story. A declared error made withDomain.RejectionorSchema.TaggedError, or asuccessthat is aSchema.Class, reaches the stub as an instance of that class. The story printed for the report, to paste into a test, makes the answer withnew.The explorer solves a class answer through its fields ("A class's own type is opaque to the solver: its fields are what an answer is made of"), and the story checks its answers the way it checks an adapter's. Nothing turned the fields back into an instance between the two, so the stub rejected every class answer Verify gave it:
Card.charge failed with an error its error schema rejects / Expected Declined.Each recorded call now keeps the schema its answer was picked from, and the answer is made again through it when the sequence is built:
The story script writes an instance of a schema class with
new, and every other answer as before:Struct answers stay as they are:
makeOptionon a struct gives back a plain object, soShop'sRiskUnavailable(Schema.TaggedStruct),FraudCheck's{ risk }andPayments'{ refundId }print and run as before. The report's "asks" lines show an instance by its class name, so for a class answer they now read→ ✗ Declinedand→ Receipt { reference: "C" }instead of→ ✗ { _tag: "Declined" }and→ { reference: "C" }.The new
Checkoutfixture has a card whose three answers are aSchema.Class, aDomain.Rejectionand aSchema.TaggedError. Its test fails onmainwith the 22 runs above and passes with this change. A sentence in the verifying-models docs says how class answers are given.#3868 (open) edits
Script.tsaround its clock lines (38 and 65), #3743 (open) editsModelSearch.tsaround 1906, 3577 and 3769, and #3607 (open) editsModelSearch.tsaround 261 and 3910. This change touchesScript.tsat its imports (3), aftermade(145) and in theAnswercase (166), andModelSearch.tsat theCallinterface (539-544), where a call is recorded (1712) and where a sequence is built (2843). No textual conflict is expected.Closes #3896