GithubHelp home page GithubHelp logo

codewithmmak / supertest-mocha-chai-javascript Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 2.0 456 KB

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.

License: MIT License

JavaScript 100.00%
api-automation api-testing-framework chaijs fakerjs mochajs mochawesome nodejs rimraf supertest supertest-mocha-chai

supertest-mocha-chai-javascript's Introduction


API Testing using SuperTest, Mocha, Chai, and FakerJS

---

GitHub Repo stars 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

API Testing using SuperTest, Mocha, Chai, and FakerJS Test Report

API Testing using SuperTest, Mocha, Chai, and FakerJS Test Report Expanded View

๐Ÿ’ญ Checkout the blogs related to Software Testing on my website

supertest-mocha-chai-javascript's People

Contributors

codewithmmak avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

supertest-mocha-chai-javascript's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @faker-js/faker ^8.0.2
  • chai ^4.3.7
  • mocha ^10.2.0
  • mochawesome ^7.1.3
  • rimraf ^5.0.1
  • supertest ^6.3.3

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.