Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions packages/core/test/filesystem/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,15 @@ describe("FileSystemSearch ripgrep fallback", () => {
yield* Effect.promise(() => fs.writeFile(path.join(cwd, "src", "match.ts"), "needle\n"))
yield* Effect.promise(() => fs.writeFile(path.join(cwd, "README.md"), "# readme\n"))
const entries = yield* findSettled("")
expect(entries.map((entry) => entry.path).sort()).toEqual([
RelativePath.make("README.md"),
RelativePath.make("src" + path.sep),
RelativePath.make("src/match.ts"),
])
// Directory entries carry the OS path separator while ripgrep returns files
// with forward slashes, so sort both sides for a platform-independent compare.
expect(entries.map((entry) => entry.path).sort()).toEqual(
[
RelativePath.make("README.md"),
RelativePath.make("src" + path.sep),
RelativePath.make("src/match.ts"),
].sort(),
)
expect(entries.find((entry) => entry.path === "src" + path.sep)?.type).toBe("directory")
}).pipe(Effect.provide(searchLayer(cwd))),
),
Expand Down
Loading