{"id":19417981,"url":"https://github.com/americanexpress/parrot","last_synced_at":"2025-05-15T20:05:06.607Z","repository":{"id":29964100,"uuid":"123139802","full_name":"americanexpress/parrot","owner":"americanexpress","description":"✨ Scenario-based HTTP mocking","archived":false,"fork":false,"pushed_at":"2025-04-24T15:54:09.000Z","size":12137,"stargazers_count":140,"open_issues_count":15,"forks_count":30,"subscribers_count":23,"default_branch":"main","last_synced_at":"2025-05-09T10:07:39.584Z","etag":null,"topics":["devtools","http","http-mocking","mock","mocking","one-app","parrot","scenarios"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/americanexpress.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-02-27T14:21:25.000Z","updated_at":"2025-04-23T15:31:39.000Z","dependencies_parsed_at":"2024-01-18T17:11:08.809Z","dependency_job_id":"10e01a5b-4e1e-40db-802c-72faa075b436","html_url":"https://github.com/americanexpress/parrot","commit_stats":{"total_commits":290,"total_committers":38,"mean_commits":7.631578947368421,"dds":0.703448275862069,"last_synced_commit":"6882800885d9683911d50317e995ca1f54e1a106"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanexpress%2Fparrot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanexpress%2Fparrot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanexpress%2Fparrot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanexpress%2Fparrot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/americanexpress","download_url":"https://codeload.github.com/americanexpress/parrot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414499,"owners_count":22067272,"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":["devtools","http","http-mocking","mock","mocking","one-app","parrot","scenarios"],"created_at":"2024-11-10T13:12:17.395Z","updated_at":"2025-05-15T20:05:04.594Z","avatar_url":"https://github.com/americanexpress.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"./assets/parrot.png\" alt=\"Parrot\" width=\"50%\" /\u003e\n\u003c/h1\u003e\n\nParrot is a set of tools that allow you to create HTTP mocks and organize them into scenarios in order to develop your app against different sets of data. We have implemented all of Parrot's functionality in JavaScript, but [scenarios](https://github.com/americanexpress/parrot/blob/main/SCENARIOS.md) are a general specification that can be implemented in any language.\n\n## 👩‍💻 Hiring 👨‍💻\n\nWant to get paid for your contributions to `parrot`?\n\n\u003e Send your resume to oneamex.careers@aexp.com\n\n## 🤹‍ Usage\n\nLet's walk through a common development workflow using Parrot.\n\n#### Define your [scenarios](https://github.com/americanexpress/parrot/blob/main/SCENARIOS.md)\n\n```js\nimport { describe, it, get, post, graphql } from 'parrot-friendly';\nimport casual from 'casual'; // for generating fake data\nimport schema from './schema'; // our GraphQL schema\n\nconst scenarios = describe('Ship Log', () =\u003e {\n  it('has a ship log', () =\u003e {\n    // respond with a mock JSON file and add a delay\n    get('/ship_log')\n      .response(require('./mocks/shipLog.json'))\n      .delay(1200);\n\n    // respond with the request body that was sent\n    post('/ship_log').response(req =\u003e req.body);\n  });\n\n  it('has a random ship log', () =\u003e {\n    // respond with random data generated by casual\n    get('/ship_log').response(() =\u003e [\n      {\n        port: casual.city,\n        captain: casual.full_name,\n      },\n    ]);\n  });\n\n  it('has a server error', () =\u003e {\n    // respond with a 500 status\n    get('/ship_log').status(500);\n  });\n\n  it('has a ship log from GraphQL', () =\u003e {\n    // respond to GraphQL queries\n    graphql('/graphql', schema, () =\u003e ({\n      ShipLog: () =\u003e require('./mocks/shipLog.json'),\n    }));\n  });\n});\n\nexport default scenarios;\n```\n\nMore information about writing scenarios can be found in the [scenarios documentation](https://github.com/americanexpress/parrot/blob/main/SCENARIOS.md).\n\n#### Add them to your server\n\n```js\nimport express from 'express';\nimport parrot from 'parrot-middleware';\nimport scenarios from './scenarios';\n\nconst app = express();\napp.use(parrot(scenarios));\napp.listen(3000);\n```\n\n#### Develop with Parrot's [devtools](https://github.com/americanexpress/parrot/blob/main/packages/parrot-devtools)\n\n![parrot-devtools](assets/parrot-devtools.gif)\n\n#### Example API requests\n\nFetch current scenario.\n\n```sh\n$ curl 'http://localhost:3002/parrot/scenario'\n```\n\nFetch all scenarios.\n\n```sh\n$ curl 'http://localhost:3002/parrot/scenarios'\n```\n\nSetting parrot to a new scenario.\n\n```sh\n$ curl -X POST -H \"Content-Type: application/json\" -d '{ \"scenario\": \"[scenario name here]\" }'  'http://localhost:3002/parrot/scenario'\n```\n\n## 📦 Packages\n\nParrot is divided into several packages that can be used together depending on your use case.\n\n| Name                                                                                                      | Description                                                     |\n| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |\n| **[parrot-core](https://github.com/americanexpress/parrot/blob/main/packages/parrot-core)**             | Core Parrot functionality that can be extended to new use cases |\n| **[parrot-devtools](https://github.com/americanexpress/parrot/blob/main/packages/parrot-devtools)**     | Devtools that allow you to switch between Parrot scenarios      |\n| **[parrot-fetch](https://github.com/americanexpress/parrot/blob/main/packages/parrot-fetch)**           | Fetch mocking implementation of Parrot                          |\n| **[parrot-friendly](https://github.com/americanexpress/parrot/blob/main/packages/parrot-friendly)**     | Helper library to write your scenarios in BDD style             |\n| **[parrot-graphql](https://github.com/americanexpress/parrot/blob/main/packages/parrot-graphql)**       | Helper library to add GraphQL mocks to your scenarios           |\n| **[parrot-middleware](https://github.com/americanexpress/parrot/blob/main/packages/parrot-middleware)** | Express middleware implementation of Parrot                     |\n| **[parrot-server](https://github.com/americanexpress/parrot/blob/main/packages/parrot-server)**         | CLI to get a parrot server up and running                       |\n\n## 🏆 Contributing\n\nWe welcome Your interest in the American Express Open Source Community on Github.\nAny Contributor to any Open Source Project managed by the American Express Open\nSource Community must accept and sign an Agreement indicating agreement to the\nterms below. Except for the rights granted in this Agreement to American Express\nand to recipients of software distributed by American Express, You reserve all\nright, title, and interest, if any, in and to Your Contributions. Please [fill out the Agreement](https://cla-assistant.io/americanexpress/parrot).\n\nPlease see our [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## 🗝️ License\n\nAny contributions made under this project will be governed by the [Apache License 2.0](./LICENSE.md).\n\n## 🗣️ Code of Conduct\n\nThis project adheres to the [American Express Community Guidelines](./CODE_OF_CONDUCT.md).\nBy participating, you are expected to honor these guidelines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famericanexpress%2Fparrot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famericanexpress%2Fparrot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famericanexpress%2Fparrot/lists"}