Skip to content
Closed
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions packages/core/test/filesystem/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import { testEffect } from "../lib/effect"

const it = testEffect(LayerNode.compile(Ripgrep.node))

// first Ripgrep use may download and extract the rg binary, which exceeds the
// default 5s test timeout on Windows CI runners (PowerShell Expand-Archive)
const RG_DOWNLOAD = { timeout: 120_000 }

const withTmp = <A, E, R>(f: (directory: AbsolutePath) => Effect.Effect<A, E, R>) =>
Effect.acquireRelease(
Effect.promise(() => tmpdir()),
Expand All @@ -26,6 +30,7 @@ describe("Ripgrep", () => {
expect(result.map((item) => item.path)).toEqual([RelativePath.make("src/match.ts")])
}),
),
RG_DOWNLOAD,
)

it.live("greps files with include filtering", () =>
Expand All @@ -40,5 +45,6 @@ describe("Ripgrep", () => {
expect(result[0]?.submatches[0]?.text).toBe("needle")
}),
),
RG_DOWNLOAD,
)
})
6 changes: 6 additions & 0 deletions packages/core/test/ripgrep.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import { testEffect } from "./lib/effect"

const it = testEffect(LayerNode.compile(Ripgrep.node))

// first Ripgrep use may download and extract the rg binary, which exceeds the
// default 5s test timeout on Windows CI runners (PowerShell Expand-Archive)
const RG_DOWNLOAD = { timeout: 120_000 }

describe("Ripgrep", () => {
it.live("keeps ignored files out of catch-all find results", () =>
Effect.acquireUseRelease(
Expand All @@ -29,6 +33,7 @@ describe("Ripgrep", () => {
}),
(tmp) => Effect.promise(() => tmp[Symbol.asyncDispose]()),
),
RG_DOWNLOAD,
)

it.live("never includes git metadata", () =>
Expand Down Expand Up @@ -61,5 +66,6 @@ describe("Ripgrep", () => {
}),
(tmp) => Effect.promise(() => tmp[Symbol.asyncDispose]()),
),
RG_DOWNLOAD,
)
})
Loading