{"id":21169723,"url":"https://github.com/sadabnepal/mountebank-supertest-api","last_synced_at":"2026-04-09T16:15:33.610Z","repository":{"id":225643760,"uuid":"766488079","full_name":"sadabnepal/mountebank-supertest-api","owner":"sadabnepal","description":"service virtualisation using mountebank stub and testing using supertest mocha and chai","archived":false,"fork":false,"pushed_at":"2024-03-17T01:51:55.000Z","size":110,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T10:50:53.061Z","etag":null,"topics":["api-test","chai","eslint","mocha","mochawesome","mocks","moutebank","service-virtualization","stub","supertest"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sadabnepal.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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":"2024-03-03T12:08:33.000Z","updated_at":"2024-04-20T07:06:35.000Z","dependencies_parsed_at":"2024-03-04T13:47:56.736Z","dependency_job_id":"91bc5246-06a7-4756-adf2-ffc60215917a","html_url":"https://github.com/sadabnepal/mountebank-supertest-api","commit_stats":null,"previous_names":["sadabnepal/mountebank-supertest-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadabnepal%2Fmountebank-supertest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadabnepal%2Fmountebank-supertest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadabnepal%2Fmountebank-supertest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadabnepal%2Fmountebank-supertest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sadabnepal","download_url":"https://codeload.github.com/sadabnepal/mountebank-supertest-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243616306,"owners_count":20319869,"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-test","chai","eslint","mocha","mochawesome","mocks","moutebank","service-virtualization","stub","supertest"],"created_at":"2024-11-20T15:53:24.086Z","updated_at":"2026-04-09T16:15:33.563Z","avatar_url":"https://github.com/sadabnepal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mountebank Supertest mocha stub and test framework\nboilerplate project to showcase virtualization of rest services using mountebank and testing rest api using supertest nodejs library with mocha framework\n\n### getting started\n```\ngit clone https://github.com/sadabnepal/mountebank-supertest-api.git\ncd mountebank-supertest-api\n```\n\n### pre-requisite\n[![NodeJs](https://img.shields.io/badge/-NodeJS-%23339933?logo=npm)](https://nodejs.org/en/download/)\n[![VSCode](https://img.shields.io/badge/-Visual%20Studio%20Code-%233178C6?logo=visual-studio-code)](https://code.visualstudio.com/download)\n\n### install packages\n```\nnpm install\n```\n\n### start stub [ for ENV=local]\n```\nnpm start\n```\n\n### set env\n```\nexport ENV=local\n         OR\nexport ENV=dev\n```\n\n### base url\n```\nlocal: http://localhost:4545/api \ndev: https://reqres.in/api\n```\n\n### run test\n```\nnpm run test\n```\n\n### stub details\nThe project is using [mountebank](http://www.mbtest.org) as a service virtualization tool, which provides following endpoints \n| http call   | endpoint               | status code | payload   |\n|-------------|------------------------|-------------|-----------|\n| GET         | `/users/\u003cid\u003e`          | 200         | N/A       |\n| GET         | `/users?page=\u003cnumber\u003e` | 200         | N/A       |\n| POST        | `/users`               | 201         | `{\"name\": \"sadab\", \"job\": \"tester\" }` |\n| PUT         | `/users/\u003cid\u003e`          | 200         | `{\"name\": \"saqib\", \"job\": \"admin\" }` |\n| POST        | `/register`            | 200         | `{\"email\": \"test@test.com\", \"password\": \"test@123\" }` |\n| POST        | `/login`               | 200         | `{\"email\": \"test@test.com\", \"password\": \"test@123\" }` |\n\nNote: default response will be empty object `{}` with response code: `404`\n\n\n### learning references:\nmountebank: http://www.mbtest.org \u003cbr\u003e\nsupertest: http://visionmedia.github \u003cbr\u003e\nmocha: https://ricostacruz.com/mocha/ \u003cbr\u003e\nmocharc: https://github.com/mochajs/mocha/tree/master/example/config \u003cbr\u003e\nchai: https://www.chaijs.com \u003cbr\u003e\nreport: https://github.com/adamgruber/mochawesome \u003cbr\u003e\neslint: https://eslint.org/docs/latest/use/getting-started \u003cbr\u003e\nvscode settings: https://code.visualstudio.com/docs/getstarted/settings\n\n### TODO\n- [x] stub setup\n- [x] simple stub\n- [x] convert stub to dynamic\n- [x] setup test framework\n- [x] create simple test\n- [x] add different env stage test support\n- [x] add lint support for quality code\n- [x] fix linting error in js files\n- [x] fix default stub response error\n- [x] add more stubs to replicate all https call\n- [x] cover all test scenarios\n- [x] create complex advance stubs (register and login)\n- [x] document all endpoints in readme\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadabnepal%2Fmountebank-supertest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsadabnepal%2Fmountebank-supertest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadabnepal%2Fmountebank-supertest-api/lists"}