(project?: string)
| 17 | }) |
| 18 | |
| 19 | async function check(project?: string) { |
| 20 | await using tmp = await tmpdir({ git: true }) |
| 21 | const link = path.join(path.dirname(tmp.path), path.basename(tmp.path) + "-link") |
| 22 | const type = process.platform === "win32" ? "junction" : "dir" |
| 23 | |
| 24 | try { |
| 25 | await fs.symlink(tmp.path, link, type) |
| 26 | expect(resolveThreadDirectory(project, link, tmp.path)).toBe(tmp.path) |
| 27 | } finally { |
| 28 | await fs.rm(link, { recursive: true, force: true }).catch(() => undefined) |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | test("uses the real cwd when PWD points at a symlink", async () => { |
| 33 | await check() |
no test coverage detected