{"id":26578748,"url":"https://github.com/sadabnepal/graphql-testing-supertest-ts","last_synced_at":"2026-04-18T02:10:52.522Z","repository":{"id":239560271,"uuid":"799858042","full_name":"sadabnepal/graphql-testing-supertest-ts","owner":"sadabnepal","description":"GraphQL API Test framework using TypeScript supertest library and mocha framework","archived":false,"fork":false,"pushed_at":"2025-03-22T06:13:03.000Z","size":637,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T07:18:36.119Z","etag":null,"topics":["graphql","graphql-testing","mocha","supertest","supertest-mocha-chai","type-utility","types","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":"2024-05-13T08:34:57.000Z","updated_at":"2025-03-22T06:13:07.000Z","dependencies_parsed_at":"2024-05-14T14:53:36.133Z","dependency_job_id":null,"html_url":"https://github.com/sadabnepal/graphql-testing-supertest-ts","commit_stats":null,"previous_names":["sadabnepal/graphql-supertest-api","sadabnepal/graphql-testing-supertest-ts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadabnepal%2Fgraphql-testing-supertest-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadabnepal%2Fgraphql-testing-supertest-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadabnepal%2Fgraphql-testing-supertest-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadabnepal%2Fgraphql-testing-supertest-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sadabnepal","download_url":"https://codeload.github.com/sadabnepal/graphql-testing-supertest-ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245056907,"owners_count":20553856,"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":["graphql","graphql-testing","mocha","supertest","supertest-mocha-chai","type-utility","types","typescript"],"created_at":"2025-03-23T05:16:24.510Z","updated_at":"2026-04-18T02:10:47.482Z","avatar_url":"https://github.com/sadabnepal.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQL Test Automation framework\nBoilerplate graphql 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\n\nClone Repository\n\n```bash\ngit clone https://github.com/sadabnepal/graphql-testing-supertest-ts.git\ncd graphql-testing-supertest-ts\n```\n\nInstall packages:\n\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 --\u003e Copy token\n- Create .env file in root project folder\n- paster actual token `GO_RES_USER_TOKEN=\u003cyour_token_goes_here\u003e`, refer .env.example file\n```\n\nSetup husky:\n\n```bash\nnpm run prepare\n```\n\nRun tests:\n\n```bash\nnpm run test\n```\n\nLint \u0026 fix:\n\n```bash\nnpm run lint\nnpm run lint:fix\n```\n\nGithub Actions :\u003cbr\u003e \u003cbr\u003e\nCurrently 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) with name `API_TOKEN` and value generated in `Setup user token` step. \u003cbr\u003e \u003cbr\u003e\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\nSample Report\n![SampleReport](./assets/report.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    - Github Action integration\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\n### Tech stacks:\n[![GraphQL](https://img.shields.io/badge/-GraphQL-E10098?logo=graphql\u0026logoColor=white)](https://www.npmjs.com/package/supertest)\n[![SuperTest](https://img.shields.io/badge/-SuperTest-07BA82?logoColor=white)](https://www.npmjs.com/package/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[![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### learning references:\n| topic           | references                                                  |\n|-----------------|-------------------------------------------------------------|\n| GraphQL         | https://graphql.org/learn                                   |\n| SuperTest       | https://github.com/ladjs/supertest#readme                   |\n| Mocha           | https://ricostacruz.com/mocha/                              |\n| Mocha config    | https://github.com/mochajs/mocha/tree/master/example/config |\n| TS style guide  | https://google.github.io/styleguide/tsguide.html            |\n| ChaiJs          | https://www.chaijs.com                                      |\n| Mochawesome     | https://github.com/adamgruber/mochawesome                   |\n| DotEnv          | https://www.npmjs.com/package/dotenv                        |\n| Eslint          | https://eslint.org/docs/latest/use/getting-started          |\n| Husky           | https://typicode.github.io/husky/                           |\n| VScode settings | https://code.visualstudio.com/docs/getstarted/settings      |\n\n\n### GraphQL Topics to Explore\n - [x] basics of GraphQL (query, mutation)\n - [ ] advance topics (fragments, unions, aliases)\n - [x] filters using arguments, variables, directive\n - [ ] setting default variable\n - [ ] variables inside fragments\n - [ ] use of directive to build dynamic/reusable query\n - [ ] fields in query vs fields in mutation\n - [ ] inline fragments (unions)\n - [ ] meta fields (fetch type of field __typename)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadabnepal%2Fgraphql-testing-supertest-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsadabnepal%2Fgraphql-testing-supertest-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadabnepal%2Fgraphql-testing-supertest-ts/lists"}