Skip to content

Instantly share code, notes, and snippets.

@eduardopc
Created April 30, 2020 01:36
Show Gist options
  • Save eduardopc/b806239a29fc9e9c00c83c4e85e217b8 to your computer and use it in GitHub Desktop.
Save eduardopc/b806239a29fc9e9c00c83c4e85e217b8 to your computer and use it in GitHub Desktop.
require('dotenv').config();
const publisher = require('@pact-foundation/pact-node');
const path = require('path');
if (process.env.PACT_LOCAL_BROKER) {
const opts = {
pactFilesOrDirs: [path.resolve(process.cwd(), 'pacts/')],
pactBroker: process.env.PACT_LOCAL_BROKER,
tags: ['test'],
consumerVersion: '1.0.0',
};
publisher.publishPacts(opts)
.catch(e => {
console.log('Publishing failed: ', e.message);
});
} else {
console.log('None value defined to PACT_BROKER env variable');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment