Skip to content

Fix up jest and mock prisma #7

Fix up jest and mock prisma

Fix up jest and mock prisma #7

Workflow file for this run

name: Run Jest Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-api:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./api
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: testing
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Generate Prisma Client
run: npx prisma generate
- name: Run Prisma Migrations
run: npx prisma migrate deploy
env:
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/testing?schema=public'
- name: Run Jest tests
run: npm test
env:
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/testing?schema=public'