babel

Typescript and Jest

May 15, 2020
babel, javascript, jest, nodejs, typescript

A short kata to configure a nodejs project, using TypeScript instead of javascript, and to create a unit test using the Jest testing framework. Requirements Create a new nodejs project and install dependencies: $ npm init -y $ npm i -D typescript nodemon \ jest \ babel-jest \ @types/jest \ @babel/preset-typescript \ @babel/preset-env \ @babel/core Initialise jest $ jest --init The following questions will help Jest to create a suitable configuration for your project √ Would you like to use Jest when running "test" script in "package. ...