Skip to content

Commit 38a02bd

Browse files
author
Test
committed
fix: update test mocks to match portable find command
Change-Id: Ib09517e68a13e580c742ee08b8adc165de245a08 Signed-off-by: Test <test@example.com>
1 parent 99a30cb commit 38a02bd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/scripts/discovery.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe("listScripts", () => {
6666
const runtime = createMockRuntime(
6767
new Map([
6868
[
69-
"find \"/test/workspace/.cmux/scripts\" -maxdepth 1 -type f -printf '%f\\n' 2>/dev/null | sort || true",
69+
`find "/test/workspace/.cmux/scripts" -maxdepth 1 -type f -print 2>/dev/null | while read f; do basename "$f"; done | sort || true`,
7070
{ stdout: "", exitCode: 1 },
7171
],
7272
])
@@ -80,7 +80,7 @@ describe("listScripts", () => {
8080
const runtime = createMockRuntime(
8181
new Map([
8282
[
83-
"find \"/test/workspace/.cmux/scripts\" -maxdepth 1 -type f -printf '%f\\n' 2>/dev/null | sort || true",
83+
`find "/test/workspace/.cmux/scripts" -maxdepth 1 -type f -print 2>/dev/null | while read f; do basename "$f"; done | sort || true`,
8484
{ stdout: "deploy\ntest.sh\n", exitCode: 0 },
8585
],
8686
[
@@ -124,7 +124,7 @@ describe("listScripts", () => {
124124
const runtime = createMockRuntime(
125125
new Map([
126126
[
127-
"find \"/test/workspace/.cmux/scripts\" -maxdepth 1 -type f -printf '%f\\n' 2>/dev/null | sort || true",
127+
`find "/test/workspace/.cmux/scripts" -maxdepth 1 -type f -print 2>/dev/null | while read f; do basename "$f"; done | sort || true`,
128128
{ stdout: "build\n", exitCode: 0 },
129129
],
130130
[
@@ -155,7 +155,7 @@ describe("listScripts", () => {
155155
const runtime = createMockRuntime(
156156
new Map([
157157
[
158-
"find \"/test/workspace/.cmux/scripts\" -maxdepth 1 -type f -printf '%f\\n' 2>/dev/null | sort || true",
158+
`find "/test/workspace/.cmux/scripts" -maxdepth 1 -type f -print 2>/dev/null | while read f; do basename "$f"; done | sort || true`,
159159
{ stdout: "script\n", exitCode: 0 },
160160
],
161161
[

0 commit comments

Comments
 (0)