refactor(core): Fix type errors in workflow, core, nodes-langchain, and nodes-base (no-changelog) (#9450)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-05-22 17:40:52 +02:00
committed by GitHub
parent d9616fc36f
commit 2bdc459bb2
98 changed files with 126 additions and 156 deletions

View File

@@ -1,7 +1,9 @@
import fs from 'node:fs/promises';
import { mock } from 'jest-mock-extended';
import { ObjectStoreManager } from '@/BinaryData/ObjectStore.manager';
import { ObjectStoreService } from '@/ObjectStore/ObjectStore.service.ee';
import { isStream } from '@/ObjectStore/utils';
import type { MetadataResponseHeaders } from '@/ObjectStore/types';
import { mockInstance, toFileId, toStream } from './utils';
jest.mock('fs/promises');
@@ -74,11 +76,13 @@ describe('getMetadata()', () => {
const mimeType = 'text/plain';
const fileName = 'file.txt';
objectStoreService.getMetadata.mockResolvedValue({
'content-length': '1',
'content-type': mimeType,
'x-amz-meta-filename': fileName,
});
objectStoreService.getMetadata.mockResolvedValue(
mock<MetadataResponseHeaders>({
'content-length': '1',
'content-type': mimeType,
'x-amz-meta-filename': fileName,
}),
);
const metadata = await objectStoreManager.getMetadata(fileId);