https://github.com/codewithmmak/supertest-mocha-chai-javascript
This is a sample API Test Automation framework designed using SuperTest, Mocha, Chai, and FakerJS. And in this framework we will see some basic working examples for learning.
https://github.com/codewithmmak/supertest-mocha-chai-javascript
api-automation api-testing-framework chaijs fakerjs mochajs mochawesome nodejs rimraf supertest supertest-mocha-chai
Last synced: 8 months ago
JSON representation
This is a sample API Test Automation framework designed using SuperTest, Mocha, Chai, and FakerJS. And in this framework we will see some basic working examples for learning.
- Host: GitHub
- URL: https://github.com/codewithmmak/supertest-mocha-chai-javascript
- Owner: codewithmmak
- License: mit
- Created: 2022-12-11T11:45:51.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-09-04T22:48:55.000Z (about 1 year ago)
- Last Synced: 2024-10-01T05:52:51.443Z (about 1 year ago)
- Topics: api-automation, api-testing-framework, chaijs, fakerjs, mochajs, mochawesome, nodejs, rimraf, supertest, supertest-mocha-chai
- Language: JavaScript
- Homepage:
- Size: 485 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
---
# API Testing using SuperTest, Mocha, Chai, and FakerJS![]()
---##  the project if you like the work.
## Getting started
### Pre-requisites
* Download and install Node.js
* Download and install any Text Editor like Visual Code/Sublime/Brackets
* Initilize the project with default settings `npm init -y`
* Install dependencies `npm install --save-dev supertest mocha chai mochawesome @faker-js/faker`### Setup Visual Code
* Install GitLens Extension from the Marketplace: `GitLens — Git supercharged by GitKraken`
* Go to Visual Code Preference > Setting and search `formatOnSave` and enable/ON it.### Setup Git Repo
* Clone the repository into a folder
* Go to Project root directory and install Dependency: `npm install`
* All the dependencies from package.json would be installed in node_modules folder.### How to write Test
* Add new spec under `test-reqres-api` folder
* Add file and name the file as testname.js (e.g. deleteTest.js)### How to Run Test
* Go to Project root directory and run command: `npm test`
* If you want to run another set of api tests then run command: `npm run test-fakerest`### How to Update local npm packages
* Go to Project root directory and run command: `npm update`### How to view HTML report
* Go to Project root directory: `./mochawesome-report/mochawesome.html`### Sample Test Results

## :thought_balloon: Checkout the blogs related to Software Testing on my [website]
[website]: https://www.codewithmmak.com/