https://github.com/forinda/prisma-mock-db-test
A testing express template for unit testing your express application
https://github.com/forinda/prisma-mock-db-test
expressjs mock-db prisma prisma-client prisma-mock prisma-orm test-db-mock testing typescript
Last synced: 3 months ago
JSON representation
A testing express template for unit testing your express application
- Host: GitHub
- URL: https://github.com/forinda/prisma-mock-db-test
- Owner: forinda
- License: gpl-3.0
- Created: 2023-01-24T19:28:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-24T19:50:13.000Z (over 3 years ago)
- Last Synced: 2025-08-24T23:14:46.750Z (10 months ago)
- Topics: expressjs, mock-db, prisma, prisma-client, prisma-mock, prisma-orm, test-db-mock, testing, typescript
- Language: JavaScript
- Homepage:
- Size: 108 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```sh
install
```
Then initialize your db
```sh
npx prisma init --datasource-provider sqlite
```
Make initial migrations
```sh
npx prisma migrate dev --name init
```
You can use the prisma studio to visualize the models defined
```sh
npx prisma studio
```
To run tour tests just run
```sh
npm run test
```
