Member-only story

GraphQL + NodeJS + MongoDB — 02 — Unit testing made easy with NestJS

Marcos Henrique da Silva
16 min readMar 6, 2022

This is a second part of my first article on how to work with GraphQL MongoDB and NodeJS in an easy way with the help of NestJS, when I will be focusing in unit.

Photo by ThisIsEngineering from Pexels

Welcome back! This is a follow up from my previous article when I scaffolded a GraphQL with MongoDB in NestJS with a CRUD and cursor pagination set.

It is expected a basic knowledge of Javascript/Typescript to follow up this article, as well of some understanding of GraphQL and MongoDB that was already provided in my previous article that you can read here.

If you are arriving here first, don’t forget to check my previous article:

We are going to start from where stopped there, using the code from this branch link.

We already have a fully functional code that allows us to run all basic CRUD operations:

  • Create: creates an user in our mongo database
  • Read: to get user by Id or list users with cursor pagination
  • Update: to update a…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Responses (2)

Write a response

there was a connection trouble in the code which i try to run ,
may you answer?

i want repo this github for unit test tks