A simple and extensible template for API testing using Jest and Supertest.
Ideal for quick setup and custom automation scripting.
This repository provides a ready-to-use template for testing RESTful APIs using:
- Jest
- Jest Extended
- Supertest
- Fake Store API for sample data
pnpm run testnode scripts/cli <file-name or api-name> --test --api--test: Generate a sample testing file (placed under__test__/)--api: Generate an API helper function file (placed undersrc/api-helper/)--force | -f: Force overwrite if file exists (please be careful!)
Example:
node scripts/cli product --test --apiWill create:
__test__/product.test.jssrc/api-helper/product.js
Example Test Report:
Check out this YouTube Demo Playlist
Make sure you have Node.js and npm installed:
node -v
pnpm -vgit clone https://github.com/Test-Architect/jest-js-sample.git
cd jest-js-samplepnpm installYou're ready to start writing tests!
Distributed under the MIT License. See LICENSE for more information.
Contributions are welcome! Feel free to open issues or submit pull requests to improve the template.

