test(windows): cover portable credential stat errors

This commit is contained in:
Tianyi Cui
2026-08-09 21:45:06 +08:00
parent 4619f183ff
commit 3fb06728be
4 changed files with 13 additions and 6 deletions

View File

@@ -191,6 +191,13 @@ describe('layer ladder', () => {
.rejects.toThrow(/ENOTDIR/)
})
it('propagates a permission check rejected before the OS lookup', async () => {
const dir = await tempDir()
const ctx = new Context()
await expect(ctx.plugin(CredentialsLocal, { path: join(dir, '.credentials\0.yaml'), watch: false }))
.rejects.toMatchObject({ code: 'ERR_INVALID_ARG_VALUE' })
})
it('propagates a read that fails for a reason other than absence', async () => {
const dir = await tempDir()
const path = join(dir, '.credentials.yaml')