Refactor and update various service and route tests for improved type safety and clarity
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled

- Added a new notes file regarding the deprecation of the Google AI JavaScript SDK.
- Removed unused imports and fixed duplicate imports in admin and auth route tests.
- Enhanced type safety in error handling for unique constraint violations in auth routes.
- Simplified gamification route tests by removing unnecessary imports.
- Updated price route to improve type safety by casting request body.
- Improved mock implementations in system route tests for better type handling.
- Cleaned up user routes by removing unused imports.
- Enhanced AI API client tests with more robust type definitions for form data.
- Updated recipe database tests to remove unused error imports.
- Refactored flyer processing service tests for better type safety and clarity.
- Improved logger client to use `unknown` instead of `any` for better type safety.
- Cleaned up notification service tests to ensure proper type casting.
- Updated queue service tests to remove unnecessary imports and improve type handling.
- Refactored queue service workers tests for better type safety in job processors.
- Cleaned up user routes integration tests by removing unused imports.
- Enhanced tests setup for unit tests to improve type safety in mocked Express requests.
- Updated PDF converter tests for better type safety in mocked return values.
- Improved price parser tests to ensure proper handling of null and undefined inputs.
This commit is contained in:
2025-12-14 18:02:16 -08:00
parent f73b1422ab
commit d4739b5784
22 changed files with 86 additions and 98 deletions

View File

@@ -4,7 +4,7 @@ import supertest from 'supertest';
import { Request, Response, NextFunction } from 'express';
import adminRouter from './admin.routes'; // This was a duplicate, fixed.
import { createMockUserProfile, createMockAdminUserView } from '../tests/utils/mockFactories';
import { User, UserProfile, Profile } from '../types';
import { UserProfile, Profile } from '../types';
import { NotFoundError } from '../services/db/errors.db';
import { mockLogger } from '../tests/utils/mockLogger';
import { createTestApp } from '../tests/utils/createTestApp';