Skip to content

Conversation

@mefellows
Copy link
Member

@mefellows mefellows commented Jul 8, 2025

This change introduces a few major changes:

  1. Refactors the v4 package types (WIP). Primarily due to lots of files violating lints (e.g. multiple classes) and to help spread the conceptual load
  2. Support for Asynchronous messages (fixes V4 Asynchronous Messages #1186)
  3. Support for passing bodies back into the executeTest function for synchronous messages
  4. Updates docs on messages/plugins (TODO)
  5. Updates examples (WIP)
  6. Incorporates the GraphQL changes for V3 and V4 interfaces (fixes Add GraphQL to V3 and V4 types #1093)

Depends on upstream change here: pact-foundation/pact-js-core#662

Merge checklist:

  • Release pact-core and merge into branch
  • Fix broken tests
  • Add commit co-authored by @valkolovos
  • External API/DSL review
  • Docs are properly synced to docs.pact.io
  • Consider making the Pact struct an alias for PactV4

@mefellows mefellows force-pushed the feat/v4-asynchronous-messages branch 2 times, most recently from 57654b5 to 46afa02 Compare August 3, 2025 12:57
@mefellows mefellows force-pushed the feat/v4-asynchronous-messages branch 3 times, most recently from b08297a to 34b142f Compare August 16, 2025 09:02
The following test creates a contract for a Dog API handler:

```js
const { MessageConsumerPact, Message, synchronousBodyHandler } = require("@pact-foundation/pact");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: update docs to reflect v4 api (see examples/v4/messages/consumer/message-consumer.spec.ts. )

@YOU54F
Copy link
Member

YOU54F commented Aug 20, 2025

Looking great so far! Will give it a test drive today

mefellows and others added 6 commits August 21, 2025 10:46
- Refactors the GraphQL common utilities into a single package
- Refactors the V4 HTTP package into multiple files (lint)
Needs cleanup of types and refactoring/extraction of examples

This change is also dependent on an upstream change in pact-core
@YOU54F YOU54F force-pushed the feat/v4-asynchronous-messages branch from 459afe9 to 7c9ff5b Compare August 21, 2025 09:46
@YOU54F
Copy link
Member

YOU54F commented Sep 15, 2025

This is a breaking change that might be nice to put these changes under

#1563

I know you would rather avoid breaking changes but this protects us in some ways :)

@mefellows
Copy link
Member Author

This is a breaking change that might be nice to put these changes under

#1563

I know you would rather avoid breaking changes but this protects us in some ways :)

If we do end up with breaking changes in this PR, good idea to release them together for sure.

@YOU54F
Copy link
Member

YOU54F commented Sep 16, 2025

I think we should be okay, we now have no changes in the existing examples which all still pass, and you've added extra test coverage with more v3/v4 example

@YOU54F
Copy link
Member

YOU54F commented Sep 16, 2025

Consider making the Pact struct an alias for PactV4

This will be a breaking change for nestjs-pact / jest-pact, just to note, as known consumers. Possibly more.

@tienvx asked over in pact-php about defaulting to v4 spec

http://github.com/pact-foundation/pact-php/issues/739

@YOU54F
Copy link
Member

YOU54F commented Sep 16, 2025

Updated bits in

#1564

  • Updates docs on messages/plugins
  • Updates examples
  • Consider making the Pact struct an alias for PactV4 (also done for MatchersV3 -> Matchers. Matchers -> MatchersV2)

@YOU54F
Copy link
Member

YOU54F commented Oct 7, 2025

included and merged as part of #1564

@YOU54F YOU54F closed this Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

V4 Asynchronous Messages Add GraphQL to V3 and V4 types

3 participants