{"id":21169705,"url":"https://github.com/sadabnepal/supertest-ts-mocha-api-test","last_synced_at":"2026-04-07T23:31:21.285Z","repository":{"id":39906100,"uuid":"487139557","full_name":"sadabnepal/supertest-ts-mocha-api-test","owner":"sadabnepal","description":"Boilerplate API test framework using Mocha, SuperTest, TypeScript and ReportPortal","archived":false,"fork":false,"pushed_at":"2024-05-13T09:52:45.000Z","size":854,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T17:26:05.507Z","etag":null,"topics":["chai","docker","eslint","githubaction-workflow","husky","mocha","report-portal","rest-api","supertest","supertest-mocha-chai","typescript"],"latest_commit_sha":null,"homepage":"","language":"HTML","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":"2022-04-29T23:53:01.000Z","updated_at":"2024-05-13T09:52:48.000Z","dependencies_parsed_at":"2025-01-21T10:41:29.396Z","dependency_job_id":"90dc136b-9139-484e-960e-42ce0a5acb50","html_url":"https://github.com/sadabnepal/supertest-ts-mocha-api-test","commit_stats":null,"previous_names":["sadabnepal/supertest-ts-mocha-api-test"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sadabnepal/supertest-ts-mocha-api-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadabnepal%2Fsupertest-ts-mocha-api-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadabnepal%2Fsupertest-ts-mocha-api-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadabnepal%2Fsupertest-ts-mocha-api-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadabnepal%2Fsupertest-ts-mocha-api-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sadabnepal","download_url":"https://codeload.github.com/sadabnepal/supertest-ts-mocha-api-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadabnepal%2Fsupertest-ts-mocha-api-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31533823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["chai","docker","eslint","githubaction-workflow","husky","mocha","report-portal","rest-api","supertest","supertest-mocha-chai","typescript"],"created_at":"2024-11-20T15:53:20.902Z","updated_at":"2026-04-07T23:31:21.268Z","avatar_url":"https://github.com/sadabnepal.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API Test Automation framework\nBoilerplate API test framework using Mocha, SuperTest and TypeScript.\n\n#### Pre-requisite:\n[![NodeJs](https://img.shields.io/badge/-NodeJS-white?logo=node.js)](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#### Getting Started:\nClone Repository\n\n```bash\ngit https://github.com/sadabnepal/supertest-ts-mocha-api-test.git\ncd supertest-ts-mocha-api-test\n```\n\nInstall the dependencies\n```bash\nnpm install\n```\n\nSetup user token\n```bash\n- Open the URL 'https://gorest.co.in/'\n- Login or Sign\n- Click on Login user drop down --\u003e Access Token\n- Create .env file and add actual token, refer .env.example file\n```\n\nRun tests\n```bash\nnpm test\nnpm run test:rp [ to capture test results in report portal ]\n```\n\nReport Path:\n```bash\npath: \u003cPROJECT_FOLDER\u003e/report/index.html\n```\n\nDocker Run:\n\u003e Setup [docker](https://docs.docker.com/get-docker/) in your local machine to run test in dockerize environment\n```bash\ndocker build -t node-api-image . [ you can given any name of your choice ]\ndocker run node-api-image:latest [ to run test inside docker ]\n```\n\nRun in Github Actions\n\u003e Currently test is setup to execute in github action on push event. You need to [create github secrete](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) for `GO_RES_USER_TOKEN` with value generated in `Setup user token` step.\n\n\u003cb\u003e Github Permission to update report: \u003c/b\u003e Go to Repository -\u003e Settings -\u003e Actions -\u003e General \u003cbr\u003e\nScroll to bottom of the page and look for 'Workflow permissions' section \u003cbr\u003e\nCheck 'Read and write permission' and click on save\n\n\n### Report Portal Integration\n- Setup: run below two command to spin up report portal instance locally with docker (read more https://reportportal.io/installation)\n    - curl -LO https://raw.githubusercontent.com/reportportal/reportportal/master/docker-compose.yml\n    - docker-compose -p reportportal up -d --force-recreate\n- Login: Open http://localhost:8080/ and login with time user `superadmin` and password `erebus`\n- Generate API key:\n    - Click on bottom left of logged in user --\u003e click on `Profile`\n    - Click on `API KEYS` --\u003e `Generate API Key` --\u003e copy the generated key\n    - Create `.env` file in root project folder. Refer `.env.example` file\n    - Paste your API key into `.env` file as `REPORT_PORTAL_KEY=\u003cyour api key\u003e`\n- Enter `REPORT_PORTAL_PROJECT=\u003cproject_assignment\u003e` into `.env`. Value can be found on `PROJECT ASSIGNMENT` tab of user profile\n- Other details are updated in `reportPortal.js` file\n\n![docker_run](./images/reportPortal.png)\n\n#### Features:\n    - Supertest library\n    - Mocha framework to organize tests\n    - Mochawesome report integration with logs\n    - Custom types for better code intellisense\n    - Service as enum for better input control\n    - Schema validation\n    - Multi environment support \n    - Docker and Github integration\n    - Enhanced import statements\n    - Request and response report logger\n    - Lint for better code quality\n    - Husky for auto lint check before code commit\n    - Manage secretes using dotenv library\n    - Runtime dynamic test data generation using faker js library\n    - AI powered Report Portal integration\n\n#### Tech stacks:\n[![SuperTest](https://img.shields.io/badge/-SuperTest-07BA82?logoColor=white)](https://github.com/visionmedia/supertest)\n[![TypeScript](https://img.shields.io/badge/-TypeScript-%233178C6?logo=Typescript\u0026logoColor=black)](https://www.typescriptlang.org/)\n[![Mocha](https://img.shields.io/badge/-Mocha-%238D6748?logo=Mocha\u0026logoColor=white)](https://mochajs.org/)\n[![ChaiJS](https://img.shields.io/badge/-ChaiJS-FEDABD?logo=Chai\u0026logoColor=black)](https://www.chaijs.com/)\n[![GithubActions](https://img.shields.io/badge/github%20actions-%232671E5?logo=githubactions\u0026logoColor=white)](https://github.com/features/actions)\n[![Docker](https://img.shields.io/badge/-Docker-0db7ed?logo=docker\u0026logoColor=white)](https://www.docker.com/)\n[![ESlint](https://img.shields.io/badge/ESLint-4B3263?logo=eslint\u0026logoColor=white)]([https://www.docker.com/](https://typescript-eslint.io/))\n[![Husky](https://img.shields.io/badge/Husky-dbc1ac?logo=gitlab\u0026logoColor=black)]([https://www.docker.com/](https://typicode.github.io/husky/))\n\n#### Folder Structure:\n```bash\n├───.github\n├───.husky\n├───.vscode\n├───src\n|     ├───data\n|     ├───env\n|     ├───helper\n|     ├───schema\n|     ├───services\n|     ├───static\n|     ├───test\n|     └───types\n├───.env.example\n├───.eslintrc.js\n├───.gitignore\n├───.mocharc.js\n├───Dockerfile\n├───package-lock.json\n├───package.json\n├───README.md\n└───tsconfig.json\n```\n\n#### Sample Report\n![SampleReport](https://user-images.githubusercontent.com/65847528/167574833-05db8fe3-e2b0-4d97-9cac-16f6f1c6c0c2.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadabnepal%2Fsupertest-ts-mocha-api-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsadabnepal%2Fsupertest-ts-mocha-api-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadabnepal%2Fsupertest-ts-mocha-api-test/lists"}