MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / createMockTreeSitterParser

Function createMockTreeSitterParser

common/src/testing/mocks/tree-sitter.ts:57–67  ·  view source on GitHub ↗
(
  options: CreateMockParserOptions = {},
)

Source from the content-addressed store, hash-verified

55}
56
57export function createMockTreeSitterParser(
58 options: CreateMockParserOptions = {},
59): MockParser {
60 const { tree, parseImpl } = options
61 const defaultTree = createMockTree()
62 const parseFn = parseImpl ?? (() => tree ?? defaultTree)
63
64 return {
65 parse: mock(parseFn),
66 }
67}
68
69export function createMockTreeSitterQuery(
70 options: CreateMockQueryOptions = {},

Callers 2

parse.test.tsFile · 0.90
createMockLanguageConfigFunction · 0.85

Calls 1

createMockTreeFunction · 0.85

Tested by

no test coverage detected