@betheweb/mockme-plugin-pact
v0.1.4
Published
A mockme plugin to generate mocks from Pact files
Downloads
2
Maintainers
Readme
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.