Last active
April 30, 2020 03:40
-
-
Save eduardopc/44e917631d2edddf3d91cce2632cc6ef 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
import { Verifier } from '@pact-foundation/pact'; | |
const providerService = `http://localhost:3378`; | |
describe('Pact Verification', () => { | |
it('should validate the expectations of the consumer service', () => { | |
const brokerOpts = { | |
provider: 'characters-api-application', | |
providerBaseUrl: providerService, | |
pactUrls: [`http://localhost:9292/pacts/provider/characters-api-application/consumer/web-application/latest`], | |
publishVerificationResult: true, | |
providerVersion: '1.0.0' | |
}; | |
// Descomentar caso queira validar o Pacto no Pactflow | |
// Alterar os valores das variáveis PACTFLOW_URI e PACTFLOW_TOKEN | |
// const pactFlowOpts = { | |
// provider: 'characters-api-application', | |
// providerBaseUrl: providerService, | |
// pactBrokerUrl: PACTFLOW_URI, | |
// pactBrokerToken: PACTFLOW_TOKEN, | |
// publishVerificationResult: true, | |
// providerVersion: '1.0.0' | |
// }; | |
return new Verifier(brokerOpts).verifyProvider(); | |
// return new Verifier(pactFlowOpts).verifyProvider(); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment