pact-foundation / jest-pact

A Pact adaptor for to allow you to easily run tests with Jest
https://pact.io
MIT License
80 stars 12 forks source link

pact-js 10.0.0 not compatible with jest-pact 0.9.0-beta.v3 #212

Closed schowave closed 2 years ago

schowave commented 2 years ago

Software versions

Please provide at least OS and version of pact-js

Issue Checklist

Please confirm the following:

Expected behaviour

Compiling the source code and importing

import { pactWith } from "jest-pact/v3"; works.

Actual behaviour

The test is not compiling, because in the jest-pact/v3/index.js there is an import

var pactV3 = require("@pact-foundation/pact/v3"); which should be (with beta.62)

var pactV3 = require("@pact-foundation/pact");

and then compilation works again.

Relevant log files

` Cannot find module '@pact-foundation/pact/v3' from '../../node_modules/.pnpm/jest-pact@0.9.0-beta.v3_bd5bdb562262fe533fb9de65840e42f8/node_modules/jest-pact/v3/index.js'

Require stack:
  C:/repos/xxx/xxx/frontend/node_modules/.pnpm/jest-pact@0.9.0-beta.v3_bd5bdb562262fe533fb9de65840e42f8/node_modules/jest-pact/v3/index.js
  src/__tests__/api/pact/XXX.pacttest.ts

  at Resolver.resolveModule (../../node_modules/.pnpm/jest-resolve@27.5.1/node_modules/jest-resolve/build/resolver.js:324:11)`
YOU54F commented 2 years ago

Hi thanks for the report @schowave, I have just come across this looks like it occurred in 10.0.0-beta.61+, will get an update out probably tomorrow now as it's quite late, and look to mainline the jest-pact beta branch now that pact-js v3 is GA

YOU54F commented 2 years ago

released in 0.10.1 of pact-js supporting pact-js 10.0.2+