Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions tavern/internal/mcp/export_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package mcp

import (
"context"

"github.com/mark3labs/mcp-go/mcp"
)

// Export for testing
var (
HandleListHosts = handleListHosts
HandleListQuests = handleListQuests
HandleListTomes = handleListTomes
HandleQuestOutput = handleQuestOutput
HandleWaitForQuest = handleWaitForQuest
ClientFromContext = clientFromContext
)

// Export internal context keys
type TestContextKey = contextKey
type TestGraphqlHandlerKey = graphqlHandlerKey

// HandleCreateQuestForTest exposes handleCreateQuest which requires the server instance.
func HandleCreateQuestForTest(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) {
// The real handler expects a server instance, but in unit tests we might
// pass a dummy or nil if the internal logic allows it.
return handleCreateQuest(nil)(ctx, req)
}
Loading
Loading