A robust API testing framework built with TypeScript, Mocha, and Supertest.
- TypeScript support
- Mocha test framework
- Chai assertions
- Supertest for API testing
- Environment configuration
- Logging system
- Response validation
- Test data generation
- Node.js (v14 or higher)
- npm (v6 or higher)
- Clone the repository:
git clone https://github.com/hiroksarker/api-testing-framework.git
cd api-testing-framework- Install dependencies:
npm install- Create a
.envfile in the root directory and add your environment variables:
API_BASE_URL=your_api_base_url
API_KEY=your_api_keyRun all tests:
npm testRun tests in watch mode:
npm run test:watchapi-testing-framework/
├── src/
│ ├── api/ # API client implementations
│ ├── config/ # Configuration files
│ ├── models/ # Type definitions
│ ├── utils/ # Helper functions
│ └── __tests__/ # Test files
├── .env # Environment variables
├── .mocharc.json # Mocha configuration
├── package.json # Project dependencies
└── tsconfig.json # TypeScript configuration
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.