fix(search): tighten mock type cast for better type safety
Replace `as any` cast with `as unknown as ReturnType<typeof createMeiliClient>` in the mock client factory. This preserves type safety without requiring the mock to implement the full SDK interface. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
indexMessage,
|
||||
deleteMessage,
|
||||
MeiliDocument,
|
||||
createMeiliClient,
|
||||
} from './index';
|
||||
|
||||
function makeMockClient() {
|
||||
@@ -15,7 +16,7 @@ function makeMockClient() {
|
||||
addDocuments: mockAddDocuments,
|
||||
deleteDocument: mockDeleteDocument,
|
||||
});
|
||||
return { client: { index: mockIndex } as any, mockIndex, mockUpdateSettings, mockAddDocuments, mockDeleteDocument };
|
||||
return { client: { index: mockIndex } as unknown as ReturnType<typeof createMeiliClient>, mockIndex, mockUpdateSettings, mockAddDocuments, mockDeleteDocument };
|
||||
}
|
||||
|
||||
describe('MESSAGES_INDEX', () => {
|
||||
|
||||
Reference in New Issue
Block a user