Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

devshafi/intro-nodejs-testing

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧪🧪 Intro to unit testing and API testing using javascript and nodejs 🧪🧪

Why testing

  • Reducing bug in production
  • Gain confidence in product
  • Can be used as documentation

Type of testing

type of testing image credit JavaScript testing best practice

We will know three types of testing

  • ✅ Unit testing
  • ✅ API testing (kind of integration testing)
  • ☑️ End to end testing (e2e)

The testing pyramid

type of testing

image credit https://www.headspin.io/

What we are using

  • Jest as test runner and assertion library.

    • Has both test runner (e.g. mocha) and assertion library (e.g. chai) integrated
    • We Need to familiar with matcher functions
  • Supertest for testing node.js HTTP server

Morty Proxy This is a proxified and sanitized view of the page, visit original site.