Skip to content

Commit 3d8d3c3

Browse files
committed
tests(ollama): remove trailing slash from Ollama server URL in tests
The commit removes the trailing slash from the Ollama server URL in test expectations to ensure consistency in how the server address is referenced. This fixes potential issues with URL handling and ensures that error messages and configuration updates use the same URL format.
1 parent cd987f8 commit 3d8d3c3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/ollamaManager.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ describe("OllamaManager", () => {
110110

111111
expect(result).toBe(true)
112112
expect(mockConfigUpdate).toHaveBeenCalledWith("provider", "ollama", true)
113-
expect(mockConfigUpdate).toHaveBeenCalledWith("ollamaHostname", "http://localhost:11434/", true)
113+
expect(mockConfigUpdate).toHaveBeenCalledWith("ollamaHostname", "http://localhost:11434", true)
114114
expect(mockConfigUpdate).toHaveBeenCalledWith("ollamaModel", "llama3.2", true)
115115
expect(mockSetStatusBarMessage).toHaveBeenCalledWith("✓ Ollama model 'llama3.2' selected successfully", 4000)
116116
})
@@ -173,7 +173,7 @@ describe("OllamaManager", () => {
173173

174174
expect(result).toBe(false)
175175
expect(mockShowErrorMessage).toHaveBeenCalledWith(
176-
"Unable to connect to Ollama server at http://localhost:11434/. Please ensure that the Ollama server is running and accessible.",
176+
"Unable to connect to Ollama server at http://localhost:11434. Please ensure that the Ollama server is running and accessible.",
177177
)
178178
})
179179

@@ -185,7 +185,7 @@ describe("OllamaManager", () => {
185185

186186
expect(result).toBe(false)
187187
expect(mockShowErrorMessage).toHaveBeenCalledWith(
188-
"Unable to connect to Ollama server at http://localhost:11434/. Please ensure that the Ollama server is running and accessible.",
188+
"Unable to connect to Ollama server at http://localhost:11434. Please ensure that the Ollama server is running and accessible.",
189189
)
190190
})
191191

@@ -197,7 +197,7 @@ describe("OllamaManager", () => {
197197

198198
expect(result).toBe(false)
199199
expect(mockShowErrorMessage).toHaveBeenCalledWith(
200-
"Ollama server not found at http://localhost:11434/. Please check the hostname and try again.",
200+
"Ollama server not found at http://localhost:11434. Please check the hostname and try again.",
201201
)
202202
})
203203

0 commit comments

Comments
 (0)