0.1.4 • Published 2 years ago

@betheweb/mockme-plugin-pact v0.1.4

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

mockme-plugin-pact

A mockme plugin to include mocks in pact files generated by contracts using @pact-foundation/pact.

How to install

Install with NPM

$ npm i -D @betheweb/mockme-plugin-pact

Install with Bun

$ bun add -D @betheweb/mockme-plugin-pact

Install with PNPM

$ pnpm add -D @betheweb/mockme-plugin-pact

How to use it

Just import it in the mockme config file and add it to the plugins section.

import mockmePluginPact from '@betheweb/mockme-plugin-pact';

export default {
  plugins: [mockmePluginPact()],
};

This plugin transform the json in the source files into mocks following the mockme mocks schema.

Configuration

input

Input accepts either a single path or an array of paths where each of them points to a file. Paths can also be a glob expression.

Example:

export default {
  plugins: [
    mockmePluginPact({
      input: ['pacts/provider.json', 'pacts/*.json'],
    }),
  ],
};

Input files

Input files are pact files, so the structure of them are well known. At the moment we assume the files are using pact V3 schema.

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago