Skip to content

Commit

Permalink
Merge pull request #1097 from mcalthrop/patch-1
Browse files Browse the repository at this point in the history
docs: fix Message link in messages examples README
  • Loading branch information
mefellows authored Jun 29, 2023
2 parents 1e37a0b + d71495d commit bff5a44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/messages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ The following test creates a contract for a Dog API handler:
1. Creates the MessageConsumer class
1. Setup the expectations for the consumer - here we expect a `dog` object with three fields
1. Pact will send the message to your message handler. If the handler returns a successful promise, the message is saved, otherwise the test fails. There are a few key things to consider:
- The actual request body that Pact will send, will be contained within a [Message](/Users/mfellows/development/public/pact-js/src/dsl/message.ts) object along with other context, so the body must be retrieved via `content` attribute.
- The actual request body that Pact will send, will be contained within a [Message](../../src/dsl/message.ts) object along with other context, so the body must be retrieved via `content` attribute.
- All handlers to be tested must be of the shape `(m: Message) => Promise<any>` - that is, they must accept a `Message` and return a `Promise`. This is how we get around all of the various protocols, and will often require a lightweight adapter function to convert it.
- In this case, we wrap the actual dogApiHandler with a convenience function `synchronousBodyHandler` provided by Pact, which Promisifies the handler and extracts the contents.

Expand Down

0 comments on commit bff5a44

Please sign in to comment.