https://github.com/kwishna/express-supertest-api
API testing using supertest library.
https://github.com/kwishna/express-supertest-api
api-testing-framework expressjs javascript nock rest-api rest-api-test supertest
Last synced: 8 months ago
JSON representation
API testing using supertest library.
- Host: GitHub
- URL: https://github.com/kwishna/express-supertest-api
- Owner: kwishna
- Created: 2024-04-14T17:27:59.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-19T13:28:42.000Z (over 1 year ago)
- Last Synced: 2024-12-28T20:21:40.795Z (10 months ago)
- Topics: api-testing-framework, expressjs, javascript, nock, rest-api, rest-api-test, supertest
- Language: TypeScript
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# API Testing Framework
This project provides a comprehensive framework for API testing using popular
Node.js libraries such as 'superagent', 'supertest', and 'nock'. It allows you
to write and execute tests for your APIs, as well as mock external API responses
for more reliable and isolated testing.## Features
- **API Testing**: Write tests for your APIs using the powerful 'superagent' and
'supertest' libraries.
- **API Mocking**: Mock external API responses using the 'nock' library,
ensuring consistent and isolated testing environments.
- **Backend ExpressJS Server**: Real API backend implemented using the 'express'
and 'mongoose' library.
- **Modular Structure**: The framework is designed with a modular structure,
making it easy to organize and maintain your tests.
- **Extensible**: Easily extend the framework with additional libraries or
custom utilities to suit your specific testing needs.## Getting Started
1. Clone the repository:
git clone https://github.com/kwishna/express-supertest-api.git
2. Install dependencies:
cd express-supertest-api npm install
3. Write your tests in the `tests/` directory, following the provided examples.
4. Run the tests.
## Project Structure
- `tests/`: Directory containing your API test files.
- `mocks/`: Directory for defining API mocks using 'nock'.
- `utils/`: Utility functions and helpers for testing.
- `package.json`: Project configuration and dependencies.## Contributing
Contributions are welcome! If you find any issues or have suggestions for
improvements, please open an issue or submit a pull request.## License
This project is not licensed. Free for use by anyone.