{"id":21215959,"url":"https://github.com/acmachado14/simple-pact","last_synced_at":"2026-03-05T16:50:15.342Z","repository":{"id":44408764,"uuid":"512272343","full_name":"acmachado14/simple-pact","owner":"acmachado14","description":"This repository aims to exemplify, in a simple and practical way, the execution of contract tests with Pact using different languages for each application.","archived":false,"fork":false,"pushed_at":"2023-12-03T03:59:49.000Z","size":262,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-12-03T23:24:25.005Z","etag":null,"topics":["nodejs","pact","pact-broker","php"],"latest_commit_sha":null,"homepage":"https://youtu.be/z53dygLyFGQ","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acmachado14.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-07-09T19:46:28.000Z","updated_at":"2023-12-03T18:37:21.000Z","dependencies_parsed_at":"2023-12-02T23:35:32.082Z","dependency_job_id":null,"html_url":"https://github.com/acmachado14/simple-pact","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmachado14%2Fsimple-pact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmachado14%2Fsimple-pact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmachado14%2Fsimple-pact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmachado14%2Fsimple-pact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acmachado14","download_url":"https://codeload.github.com/acmachado14/simple-pact/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225635475,"owners_count":17500350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","pact","pact-broker","php"],"created_at":"2024-11-20T21:48:30.377Z","updated_at":"2026-03-05T16:50:15.308Z","avatar_url":"https://github.com/acmachado14.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eContract Testing with Pact\u003c/h1\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n\n# Description\n\nThis repository aims to exemplify, in a simple and practical way, the execution of contract tests with\nPact using different languages for each application. \n\n\n# Flow\n\nThe flow used is as simple as possible to carry out the communication of the provider and consumer tests.\nIt is far from ideal for use in software productions!\nIf you want a complete flow for your application, I recommend\n[Nirvana for contract test](https://github.com/PauloGoncalvesBH/nirvana-teste-de-contrato) which makes use of CI for verification steps.\n\n\u003cimg src=\".github/fluxo-pact-broker.png\" width=\"500px\" height=\"400px\"/\u003e\n\n## Pact Broker\nThe [Pact Broker](docker-compose.yml) is responsible for the communication between the systems, ensuring the execution of the tests\nOn both sides. Thus, the consumer sends the contract containing the information he expects to receive on a given route.\nand the provider downloads this contract, executes it locally, checking if the data is being sent as expected and returns\ntest results for the Pact Broker.\n\n### Prerequisites\n- [Docker](https://docs.docker.com/get-docker/)\n- [Docker-compose](https://docs.docker.com/compose/install/)\n\n### Run Pact Broker\n ```\ndocker-compose up\n ```\n\n## Consumer\nO [consumer](./consumer) it is the application that consumes the API, it is responsible for making data requests to the provider.\n\n#### Prerequisites\n- Docker\n\n### Install\n ```\n make build\n ```\n### Run terminal in docker\n ```\n make run-it\n ```\n### Run tests\n ```\n npm run test:consumer\n ```\n### Publish the contract\n ```\n npm run pact:publish\n ```\n\n## Provider\nThe [provider](./provider) is the application that promotes the API, is responsible for sending the data requested by the consumer.\n\n#### Prerequisites\n- PHP\n- composer\n \n### Up the application\n ```\n php -S localhost:8000\n ```\n\n### Run tests\n ```\nvendor/bin/phpunit\n ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facmachado14%2Fsimple-pact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facmachado14%2Fsimple-pact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facmachado14%2Fsimple-pact/lists"}