Hey folks, We just open-sourced a library we've b...
# pact-js
m
Hey folks, We just open-sourced a library we've been using internally at SEON for Pact.js contract testing, thought it might be useful for others here. Pact is powerful but the setup boilerplate adds up fast. Every team ends up writing the same plumbing. The library extracts those patterns into composable utilities. What's in it: - createProviderState / toJsonMap : typed provider state params without the JsonMap conversion headache - buildVerifierOptions / buildMessageVerifierOptions : one call to build complete VerifierOptions for HTTP and message verification - createRequestFilter : injects auth headers into verification requests without the Express type gymnastics - handlePactBrokerUrlAndSelectors : reads env vars and assembles the right consumer version selector strategy automatically github: https://github.com/seontechnologies/pactjs-utils npm: https://www.npmjs.com/package/@seontechnologies/pactjs-utils docs: https://seontechnologies.github.io/pactjs-utils/ The repo also functions as an educational resource, dogfooding the lib, and showcasing vanilla vs lib versions of the same tests. P.S. For those moving toward agentic QA: BMad Test Architect now has a pactjs-utils installation option. It’s designed to create and self-heal contract tests using these patterns out of the box. https://bmad-code-org.github.io/bmad-method-test-architecture-enterprise/
🎉 3
💛 1
@Matt (pactflow.io / pact-js / pact-go) @vijay singh @Diana G
j
Amazing work! Looks really good! chef kiss
m
Fantastic news - we’ll find a way to share these in various places. cc @Yousaf Nabi (pactflow.io). I’ll add to next maintainer agenda (if we don’t action before)
m
BMad TeA installation with pactjs-utils

https://youtu.be/pdd-6YM9EiI▾

Pactjs-utils docs: https://seontechnologies.github.io/pactjs-utils/ BMad TeA docs & pactjs-utils: https://bmad-code-org.github.io/bmad-method-test-architecture-enterprise/reference/knowledge-base/#pact--contract-testing-integration
🚀 1
y
Wonderful work @Murat Ozcan. It would be great to get this up on the docs.pact.io site We have a pact-js section, where we can create a sub-section either for JS tools in general (there are a couple of pact msw tools, along with this pactjs-utils package, jest-pact), or just one for pactjs-utils.
m
Sounds good, however you guys want it is fine by me
Three months ago I posted about playwright-utils, BMad TEA, and Playwright MCPs. The new piece is
@seontechnologies/pactjs-utils
. I updated the blog post https://dev.to/muratkeremozcan/the-testing-meta-most-teams-have-not-caught-up-to-yet-o5i
👀 1