{"id":15714509,"url":"https://github.com/ivstudio/mock-service-worker","last_synced_at":"2025-07-16T10:33:37.994Z","repository":{"id":254517217,"uuid":"845621759","full_name":"ivstudio/mock-service-worker","owner":"ivstudio","description":"API Mocking in JavaScript using Mock Service Worker (MSW) demo.","archived":false,"fork":false,"pushed_at":"2025-07-04T21:56:38.000Z","size":6282,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T22:38:40.204Z","etag":null,"topics":["jest","msw","react","react-testing-library"],"latest_commit_sha":null,"homepage":"https://ivstudio.github.io/mock-service-worker/","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/ivstudio.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,"zenodo":null}},"created_at":"2024-08-21T15:46:30.000Z","updated_at":"2025-07-04T21:56:14.000Z","dependencies_parsed_at":"2024-08-24T01:37:44.594Z","dependency_job_id":"f97ac7ef-5bcf-486d-991c-b246cec18a32","html_url":"https://github.com/ivstudio/mock-service-worker","commit_stats":null,"previous_names":["ivstudio/mock-service-worker"],"tags_count":0,"template":false,"template_full_name":"ivstudio/react-ts-tailwind-starter","purl":"pkg:github/ivstudio/mock-service-worker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivstudio%2Fmock-service-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivstudio%2Fmock-service-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivstudio%2Fmock-service-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivstudio%2Fmock-service-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivstudio","download_url":"https://codeload.github.com/ivstudio/mock-service-worker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivstudio%2Fmock-service-worker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265503064,"owners_count":23777993,"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":["jest","msw","react","react-testing-library"],"created_at":"2024-10-03T21:37:46.534Z","updated_at":"2025-07-16T10:33:37.951Z","avatar_url":"https://github.com/ivstudio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API Mocking in JavaScript using Mock Service Worker\n\nThis repository showcases a Mock Service Worker (MSW) v2 setup in a React environment, seamlessly integrated with Jest and React Testing Library. The configuration allows MSW to intercept API calls during development and unit testing, offering comprehensive control and flexibility throughout the development process.\n\n\n[View the project](https://ivstudio.github.io/mock-service-worker/)\n\n\n## Key Features\n\n- [Detailed article](https://www.ivstudio.com/blog/mock-service-worker) providing a step-by-step explanation of the implementation process.\n- Configuration of handlers, setupWorker, and setupServer for API mocking.\n- On-demand API interception during development using MSW's browser integration.\n- API interception in Jest and React Testing Library environments using MSW's Node.js integration.\n\n\n### Tech Stack\n\n- [Mock Service Worker (MSW)](https://mswjs.io/) for API mocking\n- [Jest](https://jestjs.io/) for unit testing\n- [React Testing Library](https://testing-library.com/) for component testing\n- [React](https://react.dev/) for building the UI\n\n### Getting Started\n\n1. Clone the repository\n2. Install dependencies: `npm install`\n3. Run the mock API: `npm run dev:mock`\n4. Start the development server: `npm run dev`\n\n### Testing\n\nTo run all tests, use the following command: `npm run test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivstudio%2Fmock-service-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivstudio%2Fmock-service-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivstudio%2Fmock-service-worker/lists"}