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

Function contextWithFiles

__tests__/import-emitted-specifier.test.ts:17–31  ·  view source on GitHub ↗
(files: string[])

Source from the content-addressed store, hash-verified

15import type { ResolutionContext } from '../src/resolution';
16
17function contextWithFiles(files: string[]): ResolutionContext {
18 const set = new Set(files);
19 return {
20 getNodesInFile: () => [],
21 getNodesByName: () => [],
22 getNodesByQualifiedName: () => [],
23 getNodesByKind: () => [],
24 fileExists: (p: string) => set.has(p),
25 readFile: () => null,
26 getProjectRoot: () => '/test',
27 getAllFiles: () => files,
28 getNodesByLowerName: () => [],
29 getImportMappings: () => [],
30 } as unknown as ResolutionContext;
31}
32
33describe('emitted-extension import specifiers (`./x.js` naming `x.ts`)', () => {
34 it('maps a relative .js specifier onto the .ts source', () => {

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected