File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
packages/wrangler/src/__tests__/r2 Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
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
+ } ) ;
You can’t perform that action at this time.
0 commit comments