@@ -2,10 +2,8 @@ import { vitest, describe, it, expect, beforeEach } from "vitest"
22import { QdrantVectorStore } from "../qdrant-client"
33import { QdrantClient } from "@qdrant/js-client-rest"
44import { createHash } from "crypto"
5- import * as path from "path"
65import { getWorkspacePath } from "../../../../utils/path"
76import { MAX_SEARCH_RESULTS , SEARCH_MIN_SCORE } from "../../constants"
8- import { Payload , VectorStoreSearchResult } from "../../interfaces"
97
108// Mocks
119vitest . mock ( "@qdrant/js-client-rest" )
@@ -229,7 +227,10 @@ describe("QdrantVectorStore", () => {
229227 mockQdrantClientInstance . createCollection . mockRejectedValue ( createError )
230228 vitest . spyOn ( console , "error" ) . mockImplementation ( ( ) => { } ) // Suppress console.error
231229
232- await expect ( vectorStore . initialize ( ) ) . rejects . toThrow ( createError )
230+ // The actual error message includes the URL and error details
231+ await expect ( vectorStore . initialize ( ) ) . rejects . toThrow (
232+ / F a i l e d t o c o n n e c t t o Q d r a n t v e c t o r d a t a b a s e | v e c t o r S t o r e \. q d r a n t C o n n e c t i o n F a i l e d / ,
233+ )
233234
234235 expect ( mockQdrantClientInstance . getCollection ) . toHaveBeenCalledTimes ( 1 )
235236 expect ( mockQdrantClientInstance . createCollection ) . toHaveBeenCalledTimes ( 1 )
@@ -289,7 +290,10 @@ describe("QdrantVectorStore", () => {
289290 vitest . spyOn ( console , "error" ) . mockImplementation ( ( ) => { } )
290291 vitest . spyOn ( console , "warn" ) . mockImplementation ( ( ) => { } )
291292
292- await expect ( vectorStore . initialize ( ) ) . rejects . toThrow ( deleteError )
293+ // The actual error message includes the URL and error details
294+ await expect ( vectorStore . initialize ( ) ) . rejects . toThrow (
295+ / F a i l e d t o c o n n e c t t o Q d r a n t v e c t o r d a t a b a s e | v e c t o r S t o r e \. q d r a n t C o n n e c t i o n F a i l e d / ,
296+ )
293297
294298 expect ( mockQdrantClientInstance . getCollection ) . toHaveBeenCalledTimes ( 1 )
295299 expect ( mockQdrantClientInstance . deleteCollection ) . toHaveBeenCalledTimes ( 1 )
0 commit comments