A context over an indexed file list and the manifests on disk, recording every probe.
(files: string[], manifests: Record<string, Record<string, Record<string, string>>>)
| 23 | |
| 24 | /** A context over an indexed file list and the manifests on disk, recording every probe. */ |
| 25 | function tree(files: string[], manifests: Record<string, Record<string, Record<string, string>>>) { |
| 26 | const probes: string[] = []; |
| 27 | const context = { |
| 28 | getAllFiles: () => files, |
| 29 | fileExists: (p: string) => { |
| 30 | probes.push(p); |
| 31 | return p in manifests; |
| 32 | }, |
| 33 | readFile: (p: string) => (p in manifests ? JSON.stringify(manifests[p]) : null), |
| 34 | } as unknown as ResolutionContext; |
| 35 | return { context, probes }; |
| 36 | } |
| 37 | |
| 38 | describe('declaredDependencies: manifests below the first two levels', () => { |
| 39 | it.each([ |
no test coverage detected