O'Reilly logo

TypeScript Microservices by Parth Ghiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introduction to Pact.js

We will be utilizing the pact module (https://www.npmjs.com/package/pact) available in NPM. The overall process would be as follows, where we would n

need to do operations at both the consumer and the provider levels.

We will be dividing our implementation into two parts. We will set up a provider as well as a client to test whether the services are communicating with one another:

  • On the consumer side:
  1. We will create a mock web server that will act as a service provider rather than making an actual call. Pact.js provides this functionality out of the box.
  2. For any request that we want to check, we will define the expected response that the mock service needs to return to check whether there are any sudden changes. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required