feat: add modular services and repositories for improved code organization
Introduce repository pattern across multiple services, including `favorites`, `tags`, `sessions`, `reports`, `auth`, and more. Decouple crypto functionalities into modular services like `HashingService`, `JwtService`, and `EncryptionService`. Improve testability and maintainability by simplifying dependencies and consolidating utility logic.
This commit is contained in:
@@ -6,6 +6,9 @@ import ffmpeg from "fluent-ffmpeg";
|
||||
import sharp from "sharp";
|
||||
import { MediaService } from "./media.service";
|
||||
|
||||
import { ImageProcessorStrategy } from "./strategies/image-processor.strategy";
|
||||
import { VideoProcessorStrategy } from "./strategies/video-processor.strategy";
|
||||
|
||||
jest.mock("sharp");
|
||||
jest.mock("fluent-ffmpeg");
|
||||
jest.mock("node:fs/promises");
|
||||
@@ -29,6 +32,8 @@ describe("MediaService", () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [
|
||||
MediaService,
|
||||
ImageProcessorStrategy,
|
||||
VideoProcessorStrategy,
|
||||
{
|
||||
provide: ConfigService,
|
||||
useValue: {
|
||||
|
||||
Reference in New Issue
Block a user