{"id":15068313,"url":"https://github.com/keploy/typescript-sdk","last_synced_at":"2025-07-20T17:36:24.319Z","repository":{"id":39444953,"uuid":"464392758","full_name":"keploy/typescript-sdk","owner":"keploy","description":"Official Keploy Node SDK 🟡","archived":false,"fork":false,"pushed_at":"2024-07-23T11:18:59.000Z","size":468,"stargazers_count":22,"open_issues_count":15,"forks_count":27,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-09T22:44:30.746Z","etag":null,"topics":["data-mock","data-mocking","expressjs","hacktoberfest","javascript","keploy","mock","mocking","nocode","nodejs","stubbing","testing-framework","testing-library","typescript"],"latest_commit_sha":null,"homepage":"https://docs.keploy.io/","language":"TypeScript","has_issues":false,"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/keploy.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-28T08:12:10.000Z","updated_at":"2024-08-31T14:58:47.000Z","dependencies_parsed_at":"2023-12-21T13:09:04.766Z","dependency_job_id":"44379658-7061-47bf-9e01-b114fae66015","html_url":"https://github.com/keploy/typescript-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"keploy/template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keploy%2Ftypescript-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keploy%2Ftypescript-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keploy%2Ftypescript-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keploy%2Ftypescript-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keploy","download_url":"https://codeload.github.com/keploy/typescript-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248931489,"owners_count":21185185,"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":["data-mock","data-mocking","expressjs","hacktoberfest","javascript","keploy","mock","mocking","nocode","nodejs","stubbing","testing-framework","testing-library","typescript"],"created_at":"2024-09-25T01:33:59.673Z","updated_at":"2025-04-14T17:52:41.468Z","avatar_url":"https://github.com/keploy.png","language":"TypeScript","readme":"[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen?logo=github)](CODE_OF_CONDUCT.md)\n[![Slack](.github/slack.svg)](https://join.slack.com/t/keploy/shared_invite/zt-12rfbvc01-o54cOG0X1G6eVJTuI_orSA)\n[![License](.github/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n**Note** :- Issue Creation is disabled on this Repository, please visit [here](https://github.com/keploy/keploy/issues/new/choose) to submit issue.\n\n# Keploy Typescript-SDK\nThis is the client SDK for the [Keploy](https://github.com/keploy/keploy) testing platform. With the TypeScript SDK, you can test both your existing unit test cases in Jest and create new end-to-end test cases for your applications.\nThe **HTTP mocks/stubs and tests are the same format** and inter-exchangeable.\n\n## Contents\n1. [Installation](#installation)\n2. [Usage](#usage)\n3. [Community support](#community-support)\n\n## Installation\n1. First install [Node.js](https://nodejs.org/en/download). Then,\n```bash\n# for npm package manager\nnpm i @keploy/sdk\n```\n```bash\n# for yarn package manager\nyarn add @keploy/sdk\n```\n\n2. Install and Start the keploy binary on an independent terminal. Follow [this](https://github.com/keploy/keploy#quick-installation) guide\n\n3. Finally, install nyc as a development dependency using npm or yarn:\n```bash\n# for npm package manager\nnpm install --save-dev nyc\n```\n```bash\n# for yarn package manager\nyarn add --dev nyc\n```\nWith nyc installed, you can now use it to analyze code coverage for both unit and end-to-end test cases in your project\n\n## Usage\n### Unit and End-to-End Testing with Keploy\nKeploy simplifies the testing process by seamlessly generating end-to-end test cases without the need to write unit test files and manage mocks/stubs.\n\n 1. **Enabling Coverage** \n    To add the specified coverage-related scripts to your \u003cb\u003epackage.json\u003c/b\u003e file, you can include the following statement within the \"scripts\" section:\n    ``` bash\n            \"scripts\": {\n                // ... other scripts\n                \"test\": \"jest --coverage\",\n                \"coverage\": \"nyc npm test \u0026\u0026 npm run coverage:merge \u0026\u0026 npm run coverage:report\",\n                \"coverage:merge\": \"mkdir -p ./coverage \u0026\u0026 nyc merge ./coverage .nyc_output/out.json\",\n                \"coverage:report\": \"nyc report --reporter=lcov --reporter=text\"\n                // ... other scripts\n            }\n    ```\n 2. **A testfile to run and display coverage**\n    Create a test file that execute Keploy's end-to-end test cases along with unit testcases.  It can be called as ```Keploy.test.js```\n\n    The contents of the file will be\n    ```bash\n        const { expect } = require('@jest/globals');\n        const keploy = require('@keploy/sdk');\n        const timeOut = 300000;\n\n        describe('Keploy Server Tests', () =\u003e {\n            test('TestKeploy', (done) =\u003e {\n                const cmd = 'npm start';\n                const options = {};\n                keploy.Test(cmd, options, (err, res) =\u003e { \n                    if (err) {\n                        done(err);\n                    } else {\n                        expect(res).toBeTruthy(); // Assert the test result\n                        done();\n                    }\n                });\n            }, timeOut);\n        }, timeOut);\n    ```\n3. **RunOptions**\n    \n    ```bash\n        options {\n            delay: number; // delay for the application ro run\n            debug: boolean; // enable or disable debug flag\n            port: number; // port of keploy you want to run\n            path: string; // path of the keploy tests and mocks\n        }\n    ```\n    \n4. **Test** \n    Execute\n    ```bash\n        keploy test -c \"npm test\" --delay 10 --coverage\n    ```\n\n5. **Get Combined coverage**\n    Execute\n    ```bash\n        keploy test -c \"npm run coverage\" --delay 10 --coverage\n    ```\n\n🎉TADA: You've successfully tested end-to-end test cases alongside unit test cases without the need to write additional test files or manage mocks/stubs.\n    \n\n## Community support\nWe'd love to collaborate with you to make Keploy.io great. To get started:\n* [Slack](https://join.slack.com/t/keploy/shared_invite/zt-12rfbvc01-o54cOG0X1G6eVJTuI_orSA) - Discussions with the community and the team.\n* [GitHub](https://github.com/keploy/keploy/issues) - For bug reports and feature requests.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeploy%2Ftypescript-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeploy%2Ftypescript-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeploy%2Ftypescript-sdk/lists"}