The dist modules a thread has loaded after running `code`.
(code: string)
| 12 | |
| 13 | /** The dist modules a thread has loaded after running `code`. */ |
| 14 | function loaded(code: string): string[] { |
| 15 | const script = ` |
| 16 | const { extractFromSource } = require(${JSON.stringify(path.join(dist, 'extraction/tree-sitter.js'))}); |
| 17 | ${code} |
| 18 | console.log(JSON.stringify(Object.keys(require.cache))); |
| 19 | process.exit(0); |
| 20 | `; |
| 21 | const res = spawnSync(process.execPath, ['--disable-warning=ExperimentalWarning', '-e', script], { encoding: 'utf8' }); |
| 22 | expect(res.status, res.stderr).toBe(0); |
| 23 | return (JSON.parse(res.stdout) as string[]).map((f) => path.relative(dist, f).split(path.sep).join('/')); |
| 24 | } |
| 25 | |
| 26 | describe('framework resolvers in extraction', () => { |
| 27 | it('are not loaded for a file no framework reads', () => { |
no test coverage detected