Run the built CLI, and list the files of dist/ it loaded.
(args: string[])
| 39 | |
| 40 | /** Run the built CLI, and list the files of dist/ it loaded. */ |
| 41 | function cli(args: string[]): { stdout: string; loaded: string[] } { |
| 42 | const stdout = node(['--require', hook, BIN, ...args], dir); |
| 43 | const files = JSON.parse(fs.readFileSync(loadedList, 'utf-8')) as string[]; |
| 44 | return { |
| 45 | stdout, |
| 46 | loaded: files.filter((f) => f.startsWith(DIST)).map((f) => path.relative(DIST, f).split(path.sep).join('/')), |
| 47 | }; |
| 48 | } |
| 49 | |
| 50 | beforeAll(async () => { |
| 51 | root = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-lazy-engine-')); |
no test coverage detected