Skip to content

Commit

Permalink
refactor: support nestjs 8 (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
omermorad authored Jan 18, 2022
1 parent b84bcc4 commit ea21a90
Show file tree
Hide file tree
Showing 6 changed files with 10,087 additions and 18,738 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:

- restore_cache:
keys:
- v1-dependencies-{{ checksum "package-lock.json" }}
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-

- run:
name: Install
command: npm ci
command: yarn install --frozen-lockfile

- persist_to_workspace:
root: ~/repo
Expand All @@ -37,7 +37,7 @@ jobs:

- run:
name: Test
command: npm run test:ci
command: yarn test:ci
environment:
JEST_JUNIT_OUTPUT_DIR: ./coverage

Expand All @@ -53,7 +53,7 @@ jobs:
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package-lock.json" }}
key: v1-dependencies-{{ checksum "yarn.lock" }}

build:
<<: *defaults
Expand All @@ -63,7 +63,7 @@ jobs:

- run:
name: Build
command: npm run build
command: yarn build
environment:
NODE_ENV: 'test'

Expand All @@ -79,7 +79,7 @@ jobs:

- run:
name: Semantic Release
command: npx semantic-release
command: yarn semantic-release

workflows:
version: 2.1
Expand Down
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
## Table Of Contents

- [Installation](#installation)
- [Fully Working Example](#fully-working-example)
- [Example](#example)
- [About](#about)
- [Introduction](#introduction)
- [Getting Started](#getting-started)
- [Contributing](#contributing)
- [License](#license)
- [Acknowledgements](#acknowledgements)
Expand All @@ -35,7 +34,7 @@
npm i -D nestjs-pact @pact-foundation/pact
```

## Fully Working Example
## Example
If you want to see a fully working end-to-end example with NestJS and Pact I recommend you to
[jump to the NestJS official examples at the PactJS Github repository](https://github.com/pact-foundation/pact-js/tree/master/examples)

Expand All @@ -48,21 +47,17 @@ If you are not familiar with Pact, Pact is fast, easy and reliable testing frame
Read more on [Pact official website](https://pact.io/)

There are two main modules suggested; one for the `Provider` role (`Verifier`), and one for the `Consumer` role (creating Pact files and publish), each loaded separately.
Of course you can also use both modules and play the role of `Consumer` and `Provider` at the same time.
Of course, you can also use both modules and play the role of `Consumer` and `Provider` at the same time.

## 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.
One more thing - the usage of the modules is for testing purposes 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

**Soon we will add a full working end-to-end example to demonstrate how to Pact is working with NestJS with `nestjs-pact` package**

### Consumer

In order to use the `Consumer` module, you need to follow a few simple steps, let's go over it!
Expand Down
Loading

0 comments on commit ea21a90

Please sign in to comment.