fix(core): expose partial filesystem scan results
This commit is contained in:
parent
be8fee5c2b
commit
785918262a
3 changed files with 43 additions and 32 deletions
|
|
@ -25,6 +25,15 @@ describe("Ripgrep", () => {
|
|||
expect(files.map((item) => item.path)).toContain(RelativePath.make(".opencode/config"))
|
||||
expect(files.map((item) => item.path)).toContain(RelativePath.make(".git/config"))
|
||||
|
||||
const observed: string[] = []
|
||||
const limited = yield* ripgrep.find({
|
||||
cwd: tmp.path,
|
||||
pattern: "**/*",
|
||||
limit: 1,
|
||||
onEntry: (entry) => Effect.sync(() => observed.push(entry.path)),
|
||||
})
|
||||
expect(observed).toEqual(limited.map((item) => item.path))
|
||||
|
||||
const matches = yield* ripgrep.grep({ cwd: tmp.path, pattern: "needle", include: "config", limit: 10 })
|
||||
expect(matches.map((item) => item.entry.path)).toContain(RelativePath.make(".opencode/config"))
|
||||
expect(matches.map((item) => item.entry.path)).toContain(RelativePath.make(".git/config"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue