Fix workspace context review findings

This commit is contained in:
Yichen Jiang
2026-07-13 16:31:03 +08:00
parent adf6b8a1ab
commit aa62b5109a
40 changed files with 708 additions and 252 deletions

View File

@@ -73,6 +73,18 @@ describe('resolve', () => {
const target = await fs.resolve(join(dir, 'abs.txt'), { cwd: '/nonexistent-base' })
expect(await fs.readText(target)).toBe('absolute')
})
it('honors a pre-aborted signal', async () => {
await expect(fs.resolve('a.txt', { signal: AbortSignal.abort() })).rejects.toMatchObject({ code: 'FS_ABORTED' })
})
it('honors a signal aborted while resolution is in flight', async () => {
const controller = new AbortController()
const pending = fs.resolve('a.txt', { signal: controller.signal })
controller.abort()
await expect(pending).rejects.toMatchObject({ code: 'FS_ABORTED' })
})
})
describe('stat', () => {