pact-foundation/pact-js

`mockService` property no longer set

Opened this issue · 0 comments

This is probably a documentation bug.

Migrating some old code from 9.18.1 to 13.1.5 following the migration guides here and here resulted in broken tests.

The problem seems to be that the returned object no longer has the mockService property, so I can't get the running url from provider.mockService.baseUrl.

This meant my tests needed to be changed:

  • to use new PactV3() instead of new Pact
  • to use the provider.executeTest((mockService) => form
  • The corresponding provider.mockService.baseUrl changed to mockService.url

Expected:

Following the migration guide to result in working tests

Actual:

Following the migration guide resulted in broken tests due to provider.mockService being undefined.