This file contains 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
npm install -g json-server |
This file contains 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
{ | |
"movies":[ | |
{ | |
"id": 1, | |
"Title":"The Avengers", | |
"Year":"2012", | |
"Genre":"Action, Sci-Fi, Thriller", | |
"Actors":"Stan Lee, Robert Downey Jr., Chris Evans, Mark Ruffalo", | |
"Type":"movie" | |
}, |
This file contains 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
docker run --name pactbroker --link pactbroker-db:postgres -e PACT_BROKER_DATABASE_USERNAME=pactbrokeruser -e PACT_BROKER_DATABASE_PASSWORD=root -e PACT_BROKER_DATABASE_HOST=postgres -e PACT_BROKER_DATABASE_NAME=pactbroker -d -p 9292:9292 pactfoundation/pact-broker |
This file contains 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
{ | |
"cars":[ | |
{ | |
"id": 1, | |
"name": "Uno", | |
"age": "2012" | |
}, | |
{ | |
"id": 3, | |
"name": "Gol", |
This file contains 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
module.exports = { | |
presets: [ | |
[ | |
'@babel/preset-env', | |
{ | |
targets: { | |
node: 'current', | |
}, | |
}, | |
], |
This file contains 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 'dotenv/config'; | |
import { Pact } from '@pact-foundation/pact'; | |
import { eachLike, somethingLike, integer } from '@pact-foundation/pact/dsl/matchers'; | |
import path from 'path'; | |
import { fetchCharacters } from '../../../src/service/api'; | |
const mockProvider = new Pact({ | |
consumer: 'web-application', |
This file contains 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 'dotenv/config'; | |
import axios from 'axios'; | |
const baseUrl = `http://localhost:${process.env.MOCK_SERVER_PORT}`; | |
const fetchCharacters = async () => { | |
return await axios.get(`${baseUrl}/characters`); | |
}; |
This file contains 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
MOCK_SERVER_PORT=3377 |
This file contains 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
{ | |
"name": "testes-de-contrato", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test:consumer": "jest --runInBand __tests__/contract/consumer/consumer.spec.js" | |
}, | |
"keywords": [], | |
"author": "", |
This file contains 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
{ | |
"consumer": { | |
"name": "web-application" | |
}, | |
"provider": { | |
"name": "characters-api-application" | |
}, | |
"interactions": [ | |
{ | |
"description": "a request to list all characters", |
OlderNewer