Created
April 30, 2020 01:36
-
-
Save eduardopc/b806239a29fc9e9c00c83c4e85e217b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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