Skip to content
/ prisma-mock-db-test Public template

A testing express template for unit testing your express application

License

Notifications You must be signed in to change notification settings

forinda/prisma-mock-db-test

Repository files navigation

Prisma Singleton mock Expressjs with database testing

This is a simple implementation of mocking database tests without hitting the database This is necessary and handy when testing functionalities of your application

To get started with the project

  • Nodejs
  • Expressjs
  • SQLite
  • Jest

Run

<npm|pnpm|yarn> install 

Then initialize your db

npx prisma init --datasource-provider sqlite

Make initial migrations

npx prisma migrate dev --name init

You can use the prisma studio to visualize the models defined

npx prisma studio

To run tour tests just run

npm run test

Image