Add user database service and unit tests
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m28s
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m28s
- Implement user database service with functions for user management (create, find, update, delete). - Add comprehensive unit tests for user database service using Vitest. - Mock database interactions to ensure isolated testing. - Create setup files for unit tests to handle database connections and global mocks. - Introduce error handling for unique constraints and foreign key violations. - Enhance logging for better traceability during database operations.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
// src/services/backgroundJobService.test.ts
|
||||
import { describe, it, expect, vi, beforeEach, type Mocked } from 'vitest';
|
||||
import cron from 'node-cron';
|
||||
import * as db from './db';
|
||||
import * as db from './db/index.db';
|
||||
import { logger } from './logger.server';
|
||||
import { sendDealNotificationEmail } from './emailService.server';
|
||||
import { runDailyDealCheck, startBackgroundJobs } from './backgroundJobService';
|
||||
import { WatchedItemDeal } from '../types';
|
||||
import { AdminUserView } from './db/admin';
|
||||
import { AdminUserView } from './db/admin.db';
|
||||
|
||||
// Mock dependencies
|
||||
vi.mock('node-cron');
|
||||
|
||||
Reference in New Issue
Block a user