1.0.1 • Published 3 years ago

@websolute/nestjs-pact v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

ISC license npm version Codecov Coverage CircleCI

Table Of Contents

About

This package allows you to consume Pact.js in a way that can be used very easily in NestJS. \ Like the nature of Pact, this package is for testing purposes only.

If you are not familiar with Pact, Pact is fast, easy and reliable testing framework for integrating web apps, APIs and microservices. Read more on Pact official website

The package suggest two modules; one for the Producer role (verifying), and one for the Consumer role (creating Pact files and publish), each loaded separately. Of course you can akso use both modules and play the role of Consumer and Producer at the same time.

Installation

npm i @websolute/nestjs-pact

Introduction

The use of each of the modules suggested here, is made in the common and accepted form of NestJS modules. The simplest way is to use the register method and pass the settings directly. It is also enable to use the registerAsync method to pass the settings in the form of useFactory or useClass for example.

One more thing - the usage of the modules is done in tests only, which is not quite common in the use of NestJS modules, so there are some good examples down below. The obvious advantage of this package is that Pact can be used in combination with the techniques and benefits offered by NestJS.

Getting Started

Consumer

Producer

Note: it is highly recommended to review the sample project. It makes full use of all parts of the package and illustrates how each can be used to fulfill the appropriate role in Pact's methodology

Contributing

If you want to contribute to the project, I will be more than happy! \ Take a few minutes to review the project code, and start get your hands dirty.

It is important to note the following steps beforehand:

  1. Fork the repository
  2. Create your branch in the form of <bug|feature>// (git checkout -b feature/minor/add-something)
  3. Commit the changes to your branch
  4. Push your changes to your remote branch
  5. Open a pull request

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgements

1.0.1

3 years ago