@@ -13,7 +13,6 @@ import { afterEach, describe, expect, it, vi } from "vitest";
1313describe ( "ollama lazy imports" , ( ) => {
1414 afterEach ( ( ) => {
1515 for ( const moduleId of [
16- "./src/embedding-provider.runtime.js" ,
1716 "./src/media-understanding-provider.js" ,
1817 "./src/memory-embedding-adapter.js" ,
1918 "./src/node-inference.js" ,
@@ -29,9 +28,6 @@ describe("ollama lazy imports", () => {
2928 } ) ;
3029
3130 it ( "loads optional runtime owners only on first use" , async ( ) => {
32- let embeddingImports = 0 ;
33- const embeddingQueryCalls : unknown [ ] = [ ] ;
34- const embeddingBatchCalls : unknown [ ] = [ ] ;
3531 let mediaImports = 0 ;
3632 let memoryImports = 0 ;
3733 let nodeInferenceImports = 0 ;
@@ -49,28 +45,6 @@ describe("ollama lazy imports", () => {
4945 return false ;
5046 } ,
5147 } ) ) ;
52- vi . doMock ( "./src/embedding-provider.runtime.js" , ( ) => {
53- embeddingImports += 1 ;
54- return {
55- createOllamaEmbeddingProvider : async ( ) => {
56- return {
57- provider : {
58- id : "ollama" ,
59- model : "nomic-embed-text" ,
60- embed : async ( ...args : unknown [ ] ) => {
61- embeddingQueryCalls . push ( args ) ;
62- return [ 1 ] ;
63- } ,
64- embedBatch : async ( ...args : unknown [ ] ) => {
65- embeddingBatchCalls . push ( args ) ;
66- return [ [ 2 ] ] ;
67- } ,
68- } ,
69- client : { baseUrl : "http://127.0.0.1:11434" } ,
70- } ;
71- } ,
72- } ;
73- } ) ;
7448 vi . doMock ( "./src/memory-embedding-adapter.js" , ( ) => {
7549 memoryImports += 1 ;
7650 return {
@@ -192,7 +166,6 @@ describe("ollama lazy imports", () => {
192166 await vi . waitFor ( ( ) => expect ( wslChecks ) . toBe ( 1 ) ) ;
193167
194168 expect ( {
195- embeddingImports,
196169 mediaImports,
197170 memoryImports,
198171 nodeInferenceImports,
@@ -201,7 +174,6 @@ describe("ollama lazy imports", () => {
201174 webSearchImports,
202175 wslImports,
203176 } ) . toEqual ( {
204- embeddingImports : 0 ,
205177 mediaImports : 0 ,
206178 memoryImports : 0 ,
207179 nodeInferenceImports : 0 ,
@@ -227,19 +199,6 @@ describe("ollama lazy imports", () => {
227199 } ) ;
228200
229201 const localProvider = providers . find ( ( provider ) => provider . id === "ollama" ) ;
230- const localEmbedding = await localProvider ?. createEmbeddingProvider ?.( {
231- config : { } ,
232- model : "" ,
233- provider : "ollama" ,
234- } as never ) ;
235- expect ( localEmbedding ) . toMatchObject ( {
236- id : "ollama" ,
237- client : { baseUrl : "http://127.0.0.1:11434" } ,
238- } ) ;
239- await expect ( localEmbedding ?. embedQuery ( "query" ) ) . resolves . toEqual ( [ 1 ] ) ;
240- await expect ( localEmbedding ?. embedBatch ( [ "document" ] ) ) . resolves . toEqual ( [ [ 2 ] ] ) ;
241- expect ( embeddingQueryCalls ) . toEqual ( [ [ "query" , { inputType : "query" } ] ] ) ;
242- expect ( embeddingBatchCalls ) . toEqual ( [ [ [ "document" ] , { inputType : "document" } ] ] ) ;
243202 await expect (
244203 localProvider ?. auth [ 0 ] ?. run ( {
245204 config : { } ,
@@ -279,7 +238,6 @@ describe("ollama lazy imports", () => {
279238 } ) ;
280239
281240 expect ( {
282- embeddingImports,
283241 mediaImports,
284242 memoryImports,
285243 nodeInferenceImports,
@@ -288,7 +246,6 @@ describe("ollama lazy imports", () => {
288246 webSearchImports,
289247 wslImports,
290248 } ) . toEqual ( {
291- embeddingImports : 1 ,
292249 mediaImports : 1 ,
293250 memoryImports : 1 ,
294251 nodeInferenceImports : 1 ,
0 commit comments