From b5fde1a0b60571bee21e4a741f1d1be60d675a04 Mon Sep 17 00:00:00 2001 From: SevenWaysDP Date: Fri, 29 Sep 2023 12:13:19 +0200 Subject: [PATCH] BC-5048 - fix tests --- .../service/files-storage-upload.service.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/server/src/modules/files-storage/service/files-storage-upload.service.spec.ts b/apps/server/src/modules/files-storage/service/files-storage-upload.service.spec.ts index b679f9fcc3d..022e6a4bf0d 100644 --- a/apps/server/src/modules/files-storage/service/files-storage-upload.service.spec.ts +++ b/apps/server/src/modules/files-storage/service/files-storage-upload.service.spec.ts @@ -10,7 +10,7 @@ import { readableStreamWithFileTypeFactory } from '@shared/testing/factory/reada import { LegacyLogger } from '@src/core/logger'; import { MimeType } from 'file-type'; import FileType from 'file-type-cjs/file-type-cjs-index'; -import { Readable } from 'stream'; +import { PassThrough, Readable } from 'stream'; import { FileRecordParams } from '../controller/dto'; import { FileDto } from '../dto'; import { FileRecord, FileRecordParentType } from '../entity'; @@ -176,7 +176,7 @@ describe('FilesStorageService upload methods', () => { await service.uploadFile(userId, params, file); - expect(getMimeTypeSpy).toHaveBeenCalledWith(file.data); + expect(getMimeTypeSpy).toHaveBeenCalledWith(expect.any(PassThrough)); }); it('should call getFileRecordsOfParent with correct params', async () => {