(rel: string, content: string)
| 141 | it('drops the name match when the import appears and restores it when it goes', async () => { |
| 142 | const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-dynamic-import-sync-')); |
| 143 | const write = (rel: string, content: string): void => { |
| 144 | fs.mkdirSync(path.dirname(path.join(dir, rel)), { recursive: true }); |
| 145 | fs.writeFileSync(path.join(dir, rel), content); |
| 146 | }; |
| 147 | const plain = 'export async function a(p: string) {\n return readFile(p);\n}\n'; |
| 148 | const dynamic = "export async function a(p: string) {\n const { readFile } = await import('node:fs/promises');\n return readFile(p);\n}\n"; |
| 149 | write('src/io.ts', 'export function readFile(p: string): string { return p; }\n'); |
no test coverage detected