{"id":18234140,"url":"https://github.com/bodrovis/mocha-cassettes","last_synced_at":"2025-08-03T11:31:52.311Z","repository":{"id":47353123,"uuid":"248223890","full_name":"bodrovis/mocha-cassettes","owner":"bodrovis","description":"Record HTTP interactions in your Mocha tests","archived":false,"fork":false,"pushed_at":"2023-12-14T20:32:09.000Z","size":1235,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-16T01:07:25.020Z","etag":null,"topics":["http","mocha","nock","node","record","test","vcr"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/bodrovis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-18T12:20:34.000Z","updated_at":"2024-06-21T14:43:48.729Z","dependencies_parsed_at":"2023-12-14T21:42:11.296Z","dependency_job_id":null,"html_url":"https://github.com/bodrovis/mocha-cassettes","commit_stats":{"total_commits":161,"total_committers":4,"mean_commits":40.25,"dds":0.5093167701863355,"last_synced_commit":"64da91816e51912998620fb07c804630d6ed8220"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodrovis%2Fmocha-cassettes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodrovis%2Fmocha-cassettes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodrovis%2Fmocha-cassettes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodrovis%2Fmocha-cassettes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bodrovis","download_url":"https://codeload.github.com/bodrovis/mocha-cassettes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228540830,"owners_count":17934029,"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":["http","mocha","nock","node","record","test","vcr"],"created_at":"2024-11-04T17:03:49.153Z","updated_at":"2024-12-07T00:02:12.552Z","avatar_url":"https://github.com/bodrovis.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MochaCassettes\n\n![npm](https://img.shields.io/npm/v/mocha-cassettes)\n![CI](https://github.com/bodrovis/mocha-cassettes/actions/workflows/ci.yml/badge.svg)\n\nNode.js library based on [Nock](https://github.com/nock/nock) to record HTTP interactions in [Mocha](https://mochajs.org/) tests.\n\n## Prerequisites\n\nThis library requires Node 10 or higher.\n\n## Installation\n\nInstall with [NPM](https://npmjs.org):\n\n```\nnpm install -D mocha-cassettes\n```\n\n## Usage\n\nImport the `Cassettes` module in your test:\n\n```ts\nimport { Cassettes } from 'mocha-cassettes';\n```\n\nCreate an instance while providing a path to the folder where your recorded cassettes should reside:\n\n```ts\ndescribe('Feature', function () {\n  const cassette = new Cassettes('./test/cassettes');\n});\n```\n\nNow create the actual test:\n\n```ts\ncassette.createTest('get request', async () =\u003e {\n  const response = await got('http://localhost/test');\n  expect(response.body).to.be.equal('ok');\n}).register(this);\n```\n\nIf the cassette does not exist, it will be recorded for you once you run the test. All subsequent test runs will utilize the recorded cassette. Set the environment variable `NO_CASSETTE_MOCKING` to ignore all mocking code.\n\nHere is the full example:\n\n```ts\nimport { Cassettes } from 'mocha-cassettes';\n\ndescribe('Feature', function () {\n  const cassette = new Cassettes('./test/cassettes');\n\n  cassette.createTest('get request', async () =\u003e {\n    const response = await got('http://localhost/test');\n    expect(response.body).to.be.equal('ok');\n  }).register(this);\n});\n```\n\n## License\n\nThis library is based on [mocha-tape-deck](https://github.com/fossas/mocha-tape-deck) and licensed under the [MIT License](https://github.com/bodrovis/mocha-vcr/blob/master/LICENSE).\n\nCopyright (c) [Ilya Krukowski](http://bodrovis.tech), Roman Kutanov\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodrovis%2Fmocha-cassettes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbodrovis%2Fmocha-cassettes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodrovis%2Fmocha-cassettes/lists"}