CodeVetter · Repo Unpack · Contributor handoff
pact-foundation/pact-js
Tests and CI were inspected, not executed, and this inventory is bounded rather than exhaustive. Begin future work at the public export and the specific generation of API being changed, then follow its native calls and lifecycle tests. Preserve compatibility, inspect npm lifecycle side effects before requesting execution, and use source behavior to resolve documentation drift.
- Read src/index.ts, src/v4/index.ts, and the migration import table first: unqualified Pact now means V4 and Matchers means V3, while PactV2 preserves the older HTTP interface.
- Use the root package's Node >=22 requirement for this checkout; README still describes Node 16+ for v12 and example manifests advertise >=20, so those older statements do not establish current root support.
- Formatting conventions are Biome, single-quoted JavaScript, and two-space LF files; npm run check composes format and lint, and lint includes tsc --noEmit. CONTRIBUTING requests tests and separation of unrelated changes.
- For later authorized validation, select the affected Vitest spec before broad suites; src/v4/http/index.spec.ts targets transport configuration and hooks.spec.ts targets interaction-boundary behavior. Neither these tests nor configured CI jobs were executed in this investigation.
- Inspect lifecycle scripts before execution: root npm test downloads/installs plugins under ~/.pact, regression npm test removes pact directories, and the plugin example's pretest invokes a CLI command whose failure is suppressed with || true.
- Preserve consumer-before-provider sequencing: example and regression npm test commands generate contracts first, provider examples read those generated pact paths, and regression configs alias the SDK to local TypeScript source.
- Keep message envelopes generation-specific: legacy MessageConsumerPact delivers contents directly, V4 async adapters extract contents.content, and synchronous V4 callbacks expose Request.content plus Response[].content.
- Review reset timing when changing synchronous execution: SynchronousMessageWithResponse.executeTest invokes cleanupFn immediately after starting executeNonTransportTest, whose completion cleanup invokes it again; the supplied callback recreates the PactV4 handle.