Skip to content

Commit 0fbcdb1

Browse files
committed
update ts hover test
1 parent a633b31 commit 0fbcdb1

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ This is an [MCP](https://modelcontextprotocol.io/introduction) server that runs
147147

148148
## About
149149

150-
I hope that this server makes working with AI tools more convenient for medium and large sized codebases.
151-
152150
This codebase makes use of edited code from [gopls](https://go.googlesource.com/tools/+/refs/heads/master/gopls/internal/protocol) to handle LSP communication. See ATTRIBUTION for details. Everything here is covered by a permissive BSD style license.
153151

154152
[mcp-go](https://github.com/mark3labs/mcp-go) is used for MCP communication. Thank you for your service.

integrationtests/tests/python/hover/hover_test.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ func TestHover(t *testing.T) {
9696
line: 1000, // Line number beyond file length
9797
column: 1,
9898
unexpectedText: "def",
99+
expectedText: "failed to get hover information: request failed:",
99100
snapshotName: "outside-file",
100101
},
101102
}
@@ -119,8 +120,16 @@ func TestHover(t *testing.T) {
119120
if err != nil {
120121
// For the "OutsideFile" test, we expect an error
121122
if tt.name == "OutsideFile" {
122-
// Create a snapshot even for error case
123-
common.SnapshotTest(t, "python", "hover", tt.snapshotName, err.Error())
123+
if tt.expectedText != "" && !strings.Contains(result, tt.expectedText) {
124+
t.Errorf("Expected hover info to contain %q but got: %s", tt.expectedText, result)
125+
}
126+
127+
// Verify unexpected content is absent
128+
if tt.unexpectedText != "" && strings.Contains(result, tt.unexpectedText) {
129+
t.Errorf("Expected hover info NOT to contain %q but it was found: %s", tt.unexpectedText, result)
130+
}
131+
// Skip the snapshot test because on CI it includes unique file paths
132+
// common.SnapshotTest(t, "python", "hover", tt.snapshotName, err.Error())
124133
return
125134
}
126135
t.Fatalf("GetHoverInfo failed: %v", err)

0 commit comments

Comments
 (0)