Skip to content

Commit

Permalink
Refactor tests to be cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
d1str0 committed Nov 30, 2024
1 parent a178d55 commit c90e2f6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 120 deletions.
2 changes: 1 addition & 1 deletion api/test/routes/index.test.ts → api/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// test/root.test.ts
import Fastify, { FastifyInstance } from 'fastify';
import sensible from '@fastify/sensible';
import rootRoutes from '../../src/routes/index';
import rootRoutes from '../src/routes/index';

describe('Root Routes', () => {
let app: FastifyInstance;
Expand Down
115 changes: 0 additions & 115 deletions api/test/services/user.service.test.ts

This file was deleted.

8 changes: 4 additions & 4 deletions api/test/routes/api/user.test.ts → api/test/user.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// test/api/user.test.ts
jest.mock('../../../src/lib/prisma', () => {
jest.mock('../src/lib/prisma', () => {
const { mockDeep } = jest.requireActual('jest-mock-extended');
return {
prisma: mockDeep(),
Expand All @@ -9,11 +9,11 @@ jest.mock('bcrypt');

import Fastify, { FastifyInstance } from 'fastify';
import sensible from '@fastify/sensible';
import rootRoutes from '../../../src/routes';
import errorHandler from '../../../src/plugins/errorHandler';
import rootRoutes from '../src/routes';
import errorHandler from '../src/plugins/errorHandler';
import { DeepMockProxy } from 'jest-mock-extended';
import { PrismaClient } from '@prisma/client';
import { prisma } from '../../../src/lib/prisma';
import { prisma } from '../src/lib/prisma';

describe('User API Routes', () => {
let app: FastifyInstance;
Expand Down

0 comments on commit c90e2f6

Please sign in to comment.