Testing Node.js apps with Jest and supertest. For dummies.

  1. Firstly, we need to install the packages we’ll be using. We’ll be using jest and supertest. Install them as Dev-dependencies since we only need them in development.
npm i jest supertest --save-dev
"scripts": {
"start": "node scraper.js",
"test": "jest --verbose --runInBand"
},

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store