Skip to content

Integration testing means checking if different modules are working fine when combined together as a group.If you want a better final product, you need integration testing because can detect any change in the flow. Let's code a integration resting with jest and supertest

Notifications You must be signed in to change notification settings

ideas2codedev/Integration-Testing-with-jest-supertest-nodejs-express

Repository files navigation

Integration testing with Jest, SuperTest, nodejs & expressjs

image

Integration testing means checking if different modules are working fine when combined together as a group.If you want a better final product, you need integration testing because can detect any change in the flow. Let's code a integration resting with jest and supertest

Objetive

  • Test our home page "/"
  • Test the authorization validation "/pages"
  • Test if we return all the data from an endpoint "/pages"
  • Test if we return a specific element "/pages/1"
  • Test error message when we cannot find a specific data "/pages/15"

Requirements

  • Node >= 8.10
  • npm >= 5.6

Demo

Demo integration testing

Installation

Clone this repository

git https://github.com/ideas2codedev/Integration-Testing-with-jest-supertest-nodejs-express.git

Move to root folder and run:

npm install

Now let's start our application run:

npm start

Now let's test our application run:

npm test

Resources & Credits

NodeJS

https://nodejs.org

Express

https://expressjs.com/

Jest

https://jestjs.io/

SuperTest

https://www.npmjs.com/package/supertest

About

Integration testing means checking if different modules are working fine when combined together as a group.If you want a better final product, you need integration testing because can detect any change in the flow. Let's code a integration resting with jest and supertest

Topics

Resources

Stars

Watchers

Forks