Skip to content

Commit efd9e77

Browse files
preliminary testing
1 parent ae602cd commit efd9e77

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { writeFileSync } from "node:fs";
2+
import { mockConsoleMethods } from "../helpers/mock-console";
3+
import { runInTempDir } from "../helpers/run-in-tmp";
4+
import { runWrangler } from "../helpers/run-wrangler";
5+
6+
vi.unmock("../../wrangler-banner");
7+
describe("pipe test", () => {
8+
const std = mockConsoleMethods();
9+
runInTempDir();
10+
11+
it("should not display banner in pipe mode", async () => {
12+
writeFileSync("wormhole-img.png", "passageway");
13+
await runWrangler(
14+
`r2 object put bucket-object-test/wormhole-img.png --file ./wormhole-img.png `
15+
);
16+
await runWrangler(
17+
"r2 object get bucket-object-test/wormhole-img.png --pipe"
18+
);
19+
20+
expect(std.out).toMatchInlineSnapshot(`
21+
"
22+
⛅️ wrangler x.x.x
23+
──────────────────
24+
Resource location: local
25+
Use --remote if you want to access the remote instance.
26+
27+
Creating object \\"wormhole-img.png\\" in bucket \\"bucket-object-test\\".
28+
Upload complete."
29+
`);
30+
});
31+
});

0 commit comments

Comments
 (0)