Skip to content

Commit e7484f3

Browse files
authored
chore: stop mocking wrangler banner by default (#10868)
* chore: stop mocking wrangler banner by default * fix: weird snapshot setup in vectorize tests * make sure cert & mtls-cert tests use toMatchInlineSnapshot * mock wrangler banner in worker namespace tests explicitly * normalize uuid in vectorize tests
1 parent f62d0b6 commit e7484f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+3382
-1114
lines changed

packages/wrangler/src/__tests__/__snapshots__/kv.test.ts.snap

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`wrangler > kv namespace > create > wrangler.json > should create a namespace 1`] = `
4-
"Resource location: remote
4+
"
5+
⛅️ wrangler x.x.x
6+
──────────────────
7+
Resource location: remote
58
🌀 Creating namespace with title \\"UnitTestNamespace\\"
69
✨ Success!
710
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
@@ -29,7 +32,10 @@ exports[`wrangler > kv namespace > create > wrangler.json > should create a name
2932
`;
3033

3134
exports[`wrangler > kv namespace > create > wrangler.json > should create a namespace in an environment if configured to do so 1`] = `
32-
"Resource location: remote
35+
"
36+
⛅️ wrangler x.x.x
37+
──────────────────
38+
Resource location: remote
3339
🌀 Creating namespace with title \\"customEnv-UnitTestNamespace\\"
3440
✨ Success!
3541
To access your new KV Namespace in your Worker, add the following snippet to your configuration file in the \\"customEnv\\" environment:
@@ -63,7 +69,10 @@ exports[`wrangler > kv namespace > create > wrangler.json > should create a name
6369
`;
6470

6571
exports[`wrangler > kv namespace > create > wrangler.json > should create a namespace using configured worker name 1`] = `
66-
"Resource location: remote
72+
"
73+
⛅️ wrangler x.x.x
74+
──────────────────
75+
Resource location: remote
6776
🌀 Creating namespace with title \\"UnitTestNamespace\\"
6877
✨ Success!
6978
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
@@ -93,7 +102,10 @@ exports[`wrangler > kv namespace > create > wrangler.json > should create a name
93102
`;
94103

95104
exports[`wrangler > kv namespace > create > wrangler.json > should create a namespace with custom binding name 1`] = `
96-
"Resource location: remote
105+
"
106+
⛅️ wrangler x.x.x
107+
──────────────────
108+
Resource location: remote
97109
🌀 Creating namespace with title \\"UnitTestNamespace\\"
98110
✨ Success!
99111
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
@@ -122,7 +134,10 @@ exports[`wrangler > kv namespace > create > wrangler.json > should create a name
122134
`;
123135

124136
exports[`wrangler > kv namespace > create > wrangler.json > should create a preview namespace if configured to do so 1`] = `
125-
"Resource location: remote
137+
"
138+
⛅️ wrangler x.x.x
139+
──────────────────
140+
Resource location: remote
126141
🌀 Creating namespace with title \\"UnitTestNamespace_preview\\"
127142
✨ Success!
128143
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
@@ -137,7 +152,10 @@ To access your new KV Namespace in your Worker, add the following snippet to you
137152
`;
138153

139154
exports[`wrangler > kv namespace > create > wrangler.toml > should create a namespace 1`] = `
140-
"Resource location: remote
155+
"
156+
⛅️ wrangler x.x.x
157+
──────────────────
158+
Resource location: remote
141159
🌀 Creating namespace with title \\"UnitTestNamespace\\"
142160
✨ Success!
143161
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
@@ -154,7 +172,10 @@ name = \\"worker\\"
154172
`;
155173

156174
exports[`wrangler > kv namespace > create > wrangler.toml > should create a namespace in an environment if configured to do so 1`] = `
157-
"Resource location: remote
175+
"
176+
⛅️ wrangler x.x.x
177+
──────────────────
178+
Resource location: remote
158179
🌀 Creating namespace with title \\"customEnv-UnitTestNamespace\\"
159180
✨ Success!
160181
To access your new KV Namespace in your Worker, add the following snippet to your configuration file in the \\"customEnv\\" environment:
@@ -174,7 +195,10 @@ name = \\"worker\\"
174195
`;
175196

176197
exports[`wrangler > kv namespace > create > wrangler.toml > should create a namespace using configured worker name 1`] = `
177-
"Resource location: remote
198+
"
199+
⛅️ wrangler x.x.x
200+
──────────────────
201+
Resource location: remote
178202
🌀 Creating namespace with title \\"UnitTestNamespace\\"
179203
✨ Success!
180204
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
@@ -192,7 +216,10 @@ name = \\"other-worker\\"
192216
`;
193217

194218
exports[`wrangler > kv namespace > create > wrangler.toml > should create a namespace with custom binding name 1`] = `
195-
"Resource location: remote
219+
"
220+
⛅️ wrangler x.x.x
221+
──────────────────
222+
Resource location: remote
196223
🌀 Creating namespace with title \\"UnitTestNamespace\\"
197224
✨ Success!
198225
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:
@@ -209,7 +236,10 @@ name = \\"worker\\"
209236
`;
210237

211238
exports[`wrangler > kv namespace > create > wrangler.toml > should create a preview namespace if configured to do so 1`] = `
212-
"Resource location: remote
239+
"
240+
⛅️ wrangler x.x.x
241+
──────────────────
242+
Resource location: remote
213243
🌀 Creating namespace with title \\"UnitTestNamespace_preview\\"
214244
✨ Success!
215245
To access your new KV Namespace in your Worker, add the following snippet to your configuration file:

packages/wrangler/src/__tests__/__snapshots__/r2.test.ts.snap

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`r2 > bucket > create > wrangler.json > should create a bucket & check request inputs 1`] = `
4-
"Creating bucket 'test-bucket'...
4+
"
5+
⛅️ wrangler x.x.x
6+
──────────────────
7+
Creating bucket 'test-bucket'...
58
✅ Created bucket 'test-bucket' with default storage class of Standard.
69
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
710
{
@@ -17,7 +20,10 @@ To access your new R2 Bucket in your Worker, add the following snippet to your c
1720
`;
1821

1922
exports[`r2 > bucket > create > wrangler.json > should create a bucket with the expected default storage class 1`] = `
20-
"Creating bucket 'test-bucket'...
23+
"
24+
⛅️ wrangler x.x.x
25+
──────────────────
26+
Creating bucket 'test-bucket'...
2127
✅ Created bucket 'test-bucket' with default storage class of InfrequentAccess.
2228
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
2329
{
@@ -33,7 +39,10 @@ To access your new R2 Bucket in your Worker, add the following snippet to your c
3339
`;
3440

3541
exports[`r2 > bucket > create > wrangler.json > should create a bucket with the expected jurisdiction 1`] = `
36-
"Creating bucket 'test-bucket (eu)'...
42+
"
43+
⛅️ wrangler x.x.x
44+
──────────────────
45+
Creating bucket 'test-bucket (eu)'...
3746
✅ Created bucket 'test-bucket (eu)' with default storage class of Standard.
3847
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
3948
{
@@ -49,7 +58,10 @@ To access your new R2 Bucket in your Worker, add the following snippet to your c
4958
`;
5059

5160
exports[`r2 > bucket > create > wrangler.json > should create a bucket with the expected location hint 1`] = `
52-
"Creating bucket 'test-bucket'...
61+
"
62+
⛅️ wrangler x.x.x
63+
──────────────────
64+
Creating bucket 'test-bucket'...
5365
✅ Created bucket 'test-bucket' with location hint weur and default storage class of Standard.
5466
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
5567
{
@@ -65,7 +77,10 @@ To access your new R2 Bucket in your Worker, add the following snippet to your c
6577
`;
6678

6779
exports[`r2 > bucket > create > wrangler.toml > should create a bucket & check request inputs 1`] = `
68-
"Creating bucket 'test-bucket'...
80+
"
81+
⛅️ wrangler x.x.x
82+
──────────────────
83+
Creating bucket 'test-bucket'...
6984
✅ Created bucket 'test-bucket' with default storage class of Standard.
7085
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
7186
[[r2_buckets]]
@@ -75,7 +90,10 @@ binding = \\"test_bucket\\"
7590
`;
7691

7792
exports[`r2 > bucket > create > wrangler.toml > should create a bucket with the expected default storage class 1`] = `
78-
"Creating bucket 'test-bucket'...
93+
"
94+
⛅️ wrangler x.x.x
95+
──────────────────
96+
Creating bucket 'test-bucket'...
7997
✅ Created bucket 'test-bucket' with default storage class of InfrequentAccess.
8098
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
8199
[[r2_buckets]]
@@ -85,7 +103,10 @@ binding = \\"test_bucket\\"
85103
`;
86104

87105
exports[`r2 > bucket > create > wrangler.toml > should create a bucket with the expected jurisdiction 1`] = `
88-
"Creating bucket 'test-bucket (eu)'...
106+
"
107+
⛅️ wrangler x.x.x
108+
──────────────────
109+
Creating bucket 'test-bucket (eu)'...
89110
✅ Created bucket 'test-bucket (eu)' with default storage class of Standard.
90111
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
91112
[[r2_buckets]]
@@ -95,7 +116,10 @@ binding = \\"test_bucket\\"
95116
`;
96117

97118
exports[`r2 > bucket > create > wrangler.toml > should create a bucket with the expected location hint 1`] = `
98-
"Creating bucket 'test-bucket'...
119+
"
120+
⛅️ wrangler x.x.x
121+
──────────────────
122+
Creating bucket 'test-bucket'...
99123
✅ Created bucket 'test-bucket' with location hint weur and default storage class of Standard.
100124
To access your new R2 Bucket in your Worker, add the following snippet to your configuration file:
101125
[[r2_buckets]]

packages/wrangler/src/__tests__/ai.test.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ describe("ai commands", () => {
8686
mockAIListFinetuneRequest();
8787
await runWrangler("ai finetune list");
8888
expect(std.out).toMatchInlineSnapshot(`
89-
"┌─┬─┬─┐
89+
"
90+
⛅️ wrangler x.x.x
91+
──────────────────
92+
┌─┬─┬─┐
9093
│ finetune_id │ name │ description │
9194
├─┼─┼─┤
9295
│ 4d73459a-0000-4688-0000-b19fbb0e0fa5 │ instruct-demo1 │ │
@@ -108,7 +111,10 @@ describe("ai commands", () => {
108111
mockAISearchRequest();
109112
await runWrangler("ai models");
110113
expect(std.out).toMatchInlineSnapshot(`
111-
"┌─┬─┬─┬─┐
114+
"
115+
⛅️ wrangler x.x.x
116+
──────────────────
117+
┌─┬─┬─┬─┐
112118
│ model │ name │ description │ task │
113119
├─┼─┼─┼─┤
114120
│ 429b9e8b-d99e-44de-91ad-706cf8183658 │ @cloudflare/embeddings_bge_large_en │ │ │
@@ -126,7 +132,10 @@ describe("ai commands", () => {
126132
mockAIOverflowRequest();
127133
await runWrangler("ai models");
128134
expect(std.out).toMatchInlineSnapshot(`
129-
"┌─┬─┬─┬─┐
135+
"
136+
⛅️ wrangler x.x.x
137+
──────────────────
138+
┌─┬─┬─┬─┐
130139
│ model │ name │ description │ task │
131140
├─┼─┼─┼─┤
132141
│ 429b9e8b-d99e-44de-91ad-706cf8183658 │ @cloudflare/embeddings_bge_large_en │ │ │
@@ -144,7 +153,10 @@ describe("ai commands", () => {
144153
mockAIPaginatedRequest();
145154
await runWrangler("ai models");
146155
expect(std.out).toMatchInlineSnapshot(`
147-
"┌─┬─┬─┬─┐
156+
"
157+
⛅️ wrangler x.x.x
158+
──────────────────
159+
┌─┬─┬─┬─┐
148160
│ model │ name │ description │ task │
149161
├─┼─┼─┼─┤
150162
│ 429b9e8b-d99e-44de-91ad-706cf8183658 │ @cloudflare/embeddings_bge_large_en │ │ │

0 commit comments

Comments
 (0)