test: cover the glob path arg in the fake-executor tier
CI has no rg, so the integration suite self-skips there and the fake-executor suite must carry the per-file 100% coverage gate alone. parseGlobArgs's valid-path branch was only exercised by integration (node 24 / coverage failed at 95.45% branches on glob.ts); a fake-tier test now threads a valid path through to the quoted `-- 'sub'` root.
This commit is contained in:
@@ -459,6 +459,14 @@ describe('glob results', () => {
|
||||
expect(text(await call(ctx, 'glob', { pattern: '*', path: ' ' }))).toContain('path must be a non-empty string')
|
||||
})
|
||||
|
||||
it('threads a valid path through to the command as the quoted search root', async () => {
|
||||
const { ctx, bash } = await setup()
|
||||
bash.handler = () => runResult('sub/a.ts\n')
|
||||
const result = await call(ctx, 'glob', { pattern: '*.ts', path: 'sub' })
|
||||
expect(result.isError).toBe(false)
|
||||
expect(bash.specs[0]?.command).toContain("-- 'sub'")
|
||||
})
|
||||
|
||||
it('caps at globMaxResults and saves the FULL sorted list through spillFiles', async () => {
|
||||
const { ctx, bash, spill } = await setup({ config: { globMaxResults: 2 }, spill: true })
|
||||
bash.handler = () => runResult('a.ts\nb.ts\nc.ts\nd.ts\n')
|
||||
|
||||
Reference in New Issue
Block a user