Skip to content

A very basic but very useful example. This example will show you how to write a sample unit test using mocha and chai.

Notifications You must be signed in to change notification settings

ashish9308/API-test-using-Mocha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

API-test-using-Mocha

A very basic but very useful example. This example will show you how to write a sample unit test using mocha and generate a report of the test using mochawesome.

Features

  • Written in JavaScript
  • Hits the Galactic endpoints from the outside world
  • Assertions on the JSON response
  • Quick and efficent
  • Easy to write new tests
  • Generate cool report using mochawsome

Sample Report

report

Installation

  1. Install node.js, by either crack open your favourite package manager: typically apt-get install nodejs on Debian/Ubuntu Linux, brew install node on a Mac or directly from the website http://nodejs.org

  2. Clone the repository from github:

$ git clone https://github.com/ashish9308/API-test-using-Mocha.git

  1. CD into the repository

$ cd API-test-using-Mocha

  1. Install all the dependencies by:

$ npm install

  1. Fire up Mocha to run the tests!

$ mocha

  1. Fire up Mocha with reporter mochawesome to run the tests and generate reports!

$ mocha test.js --reporter mochawesome

  1. Want to know more about mochawsome reporter please go to this link

https://github.com/adamgruber/mochawesome

About

A very basic but very useful example. This example will show you how to write a sample unit test using mocha and chai.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published