MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / isTestCode

Function isTestCode

src/graph/test-code.ts:21–25  ·  view source on GitHub ↗
(node: Node, source?: string)

Source from the content-addressed store, hash-verified

19
20/** `node` is test code. `source` is the node's file, read when the caller has it. */
21export function isTestCode(node: Node, source?: string): boolean {
22 if (isTestFile(node.filePath)) return true;
23 if (node.qualifiedName && isTestScope(node.qualifiedName)) return true;
24 return node.language === 'rust' && source !== undefined && inCfgTestModule(source, node.startLine);
25}
26
27/**
28 * `line` (1-based) is inside a module declared under a test `cfg`. The

Callers 1

mainFunction · 0.90

Calls 3

isTestFileFunction · 0.90
isTestScopeFunction · 0.90
inCfgTestModuleFunction · 0.85

Tested by

no test coverage detected