{"id":20920142,"url":"https://github.com/icedfrisby/icedfrisby","last_synced_at":"2025-10-09T11:35:50.450Z","repository":{"id":27804475,"uuid":"31293782","full_name":"IcedFrisby/IcedFrisby","owner":"IcedFrisby","description":"HTTP testing framework built on Mocha that makes testing API endpoints easy, fast, and fun","archived":false,"fork":false,"pushed_at":"2023-01-16T19:02:14.000Z","size":1949,"stargazers_count":42,"open_issues_count":31,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T00:04:33.610Z","etag":null,"topics":["api","api-server","api-testing","apis","bdd","mocha","mocha-tests","rest","rest-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IcedFrisby.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-25T02:40:55.000Z","updated_at":"2024-01-19T18:05:51.000Z","dependencies_parsed_at":"2023-02-10T05:45:38.116Z","dependency_job_id":null,"html_url":"https://github.com/IcedFrisby/IcedFrisby","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IcedFrisby%2FIcedFrisby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IcedFrisby%2FIcedFrisby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IcedFrisby%2FIcedFrisby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IcedFrisby%2FIcedFrisby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IcedFrisby","download_url":"https://codeload.github.com/IcedFrisby/IcedFrisby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248143344,"owners_count":21054762,"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":["api","api-server","api-testing","apis","bdd","mocha","mocha-tests","rest","rest-api"],"created_at":"2024-11-18T18:08:54.076Z","updated_at":"2025-10-09T11:35:45.391Z","avatar_url":"https://github.com/IcedFrisby.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IcedFrisby\n\n[![Build Status](https://img.shields.io/circleci/project/github/IcedFrisby/IcedFrisby/master.svg)](https://circleci.com/gh/IcedFrisby/IcedFrisby/tree/master)\n[![Coverage Status](https://img.shields.io/coveralls/github/IcedFrisby/IcedFrisby.svg)](https://coveralls.io/github/IcedFrisby/IcedFrisby)\n[![npm](https://img.shields.io/npm/v/icedfrisby.svg)](http://www.npmjs.com/package/icedfrisby)\n\n**IcedFrisby** is a Node.js library that makes testing API endpoints easy, fast and fun.\n\n## :orange_book: API Documentation\n\nThe [**IcedFrisby** API Docs](https://github.com/IcedFrisby/IcedFrisby/blob/master/API.md) are located in [API.md](https://github.com/IcedFrisby/IcedFrisby/blob/master/API.md).\n\n## Changelog\n\nThe [**IcedFrisby** Changelog](https://github.com/IcedFrisby/IcedFrisby/blob/master/CHANGELOG.md) is located in [CHANGELOG.md](https://github.com/IcedFrisby/IcedFrisby/blob/master/CHANGELOG.md).\n\n## Upgrading from 1.5.0 to 2.0.0\n\n1. Ensure you're using Node 8+.\n2. If using `expectJSONTypes`, add `@hapi/joi` to `devDependencies`.\n3. Replace calls to `globalConfig()` and `reset()` with calls to `.config()`.\n   If necessary, create a helper function which invokes\n   `frisby.create().config()`.\n4. Consider running your tests using `async run()` instead of `toss()` if it\n   improves your workflow.\n\nThe full set of changes is documented [in the changelog][changelog-2.0.0].\n\n[changelog-2.0.0]: https://github.com/IcedFrisby/IcedFrisby/blob/master/CHANGELOG.md#2.0.0\n\n## What makes IcedFrisby different?\n\n- Uses [Mocha](https://github.com/mochajs/mocha) as the driver\n- Uses [Chai](https://github.com/chaijs/chai) for assertions\n- Uses [Joi][] for flexible and simple schema/type JSON validation\n- `expectJSON(...)` is strict. Undefined/null fields are not ignored and missing fields are considered errors\n- `expectContainsJSON(...)` tests JSON responses without knowing every field.\n- Returns a 599 (network timeout error) response if a request times out or is unavailable instead of a 500\n\n## Installation\n\nInstall IcedFrisby and Mocha from NPM:\n\n    npm install mocha icedfrisby --save-dev\n\nIf you are using `expectJSONTypes`, install [Joi][] too:\n\n    npm install @hapi/joi --save-dev\n\nIcedFrisby is built and tested against Node 8 and 10.\n\n[joi]: https://github.com/hapijs/joi\n\n## Show me some code!\n\nIcedFrisby tests start with `frisby.create()` with a description of the test followed by one of `get()`, `put()`, `post()`, `delete()`, or `head()`, and ending with `toss()` to generate the resulting Mocha test. There is a `expectStatus()` method built in to more easily test HTTP status codes. Any other Mocha `expect` tests should be done inside the `after()` or `afterJSON()` callback.\n\nEach set of unique sequences or API endpoint tests should be started with new `frisby.toss` method calls instead of trying to chain multiple HTTP requests together.\n\n```javascript\nconst frisby = require('icedfrisby')\nconst Joi = require('@hapi/joi')\n\nconst URL = 'http://localhost:3000/'\nconst URL_AUTH = 'http://username:password@localhost:3000/'\n\nfrisby\n  .create('GET user johndoe')\n  .get(URL + '/users/3.json')\n  .addHeader('X-Auth-Token', 'fa8426a0-8eaf-4d22-8e13-7c1b16a9370c')\n  .expectStatus(200)\n  .expectJSONTypes({\n    id: Joi.number(),\n    username: Joi.string(),\n    is_admin: Joi.boolean(),\n  })\n  .expectJSON({\n    id: 3,\n    username: 'johndoe',\n    is_admin: false,\n  })\n  // 'afterJSON' automatically parses response body as JSON and passes it as an argument\n  .afterJSON(user =\u003e {\n    // You can use any normal assertions here\n    expect(1 + 1).to.equal(2)\n\n    // Use data from previous result in next test\n    frisby\n      .create('Update user')\n      .put(URL_AUTH + '/users/' + user.id + '.json', { tags: ['mocha', 'bdd'] })\n      .expectStatus(200)\n      .toss()\n  })\n  .toss()\n```\n\nAny Mocha/Chai/whatever tests can be used inside the `after` and `afterJSON` callbacks to perform additional or custom tests on the response data.\n\n## Running Tests\n\nRun tests as you normally would with [Mocha](https://github.com/mochajs/mocha).\n\nFor example:\n\n    cd your/project\n    mocha tests/someTest.js --reporter nyan\n\n## Plugins\n\nPlugins can provide custom assertions, setup and teardown logic, and\nadditional functionality. Plugins can be implemented in an application's test\ncode or as a library.\n\n- [icedfrisby-nock](https://github.com/paulmelnikow/icedfrisby-nock) \u0026mdash;\n  Concise support for mock requests\n- [icedfrisby-jsonrefchecks](https://github.com/Fishbowler/icedfrisby-jsonrefchecks) \u0026mdash;\n  Check referential integrity between different sections of an API response\n\nTo use a plugin, compose IcedFrisby with it:\n\n```js\nconst frisby = require('./icedfrisby-nock')(require('icedfrisby'))\n```\n\nor, more semantically, using the delightful [mixwith][]:\n\n```js\nconst { mix } = require('mixwith')\n\nconst frisby = mix(require('icedfrisby')).with(require('./icedfrisby-nock'))\n```\n\n[mixwith]: https://github.com/justinfagnani/mixwith.js\n\nWriting your own plugin is easy. For more details see [CONTRIBUTING.md].\n\n## Contributing\n\nContributions are awesome! If you have an idea or code that you want to\ncontribute, feel free to open an issue or a pull request and we will gladly\nreview it. For more details see [CONTRIBUTING.md]\n\n### Code Coverage\n\nYou can assess code coverage by running `npm run coverage`.\n\n### Contributions\n\nContributions are awesome! If you have an idea or code that you want to\ncontribute, feel free to open an issue or a pull request and we will gladly\nreview it.\n\nThe library is post-1.0 now, so there is backward compatibility and future\nmaintainability to consider. If you are adding functionality, you can also\nwrite a [plugin](#icedfrisby-plugins) and add a link here.\n\n### Maintainers\n\nIcedFrisby is maintained by:\n\n- [Dan Caseley](https://github.com/Fishbowler)\n- [Mark Herhold](https://github.com/MarkHerhold)\n- [Paul Melnikow](https://github.com/paulmelnikow)\n- [Casey Vega](https://github.com/cvega)\n\n### Roadmap\n\n1. Make output errors more useful. It can be hard to track down which assertion is causing what error.\n1. Add a \"stack trace\" for paths to help discern why a path traversal failed\n1. Support [chained tests/promises](https://github.com/vlucas/frisby/issues/223). Related: [#127](https://github.com/vlucas/frisby/issues/127), [#154](https://github.com/vlucas/frisby/issues/154), [#200](https://github.com/vlucas/frisby/issues/200)\n1. ~~custom assertion plugin support~~ :rocket: [#27](https://github.com/IcedFrisby/icedfrisby/issues/27)\n\n## Acknowledgements\n\nIcedFrisby was originally based on the [Frisby](https://github.com/vlucas/frisby) project.\n\n## License\n\nLicensed under the [MIT](http://opensource.org/licenses/MIT)/[BSD](http://opensource.org/licenses/BSD-3-Clause) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficedfrisby%2Ficedfrisby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficedfrisby%2Ficedfrisby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficedfrisby%2Ficedfrisby/lists"}