wrangler 2.0.2 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,10 +44,9 @@ describe("wrangler", () => {
44
44
  wrangler whoami 🕵️ Retrieve your user info and test your auth config
45
45
 
46
46
  Flags:
47
- -c, --config Path to .toml configuration file [string]
48
- -h, --help Show help [boolean]
49
- -v, --version Show version number [boolean]
50
- --legacy-env Use legacy environments [boolean]"
47
+ -c, --config Path to .toml configuration file [string]
48
+ -h, --help Show help [boolean]
49
+ -v, --version Show version number [boolean]"
51
50
  `);
52
51
 
53
52
  expect(std.err).toMatchInlineSnapshot(`""`);
@@ -64,10 +63,7 @@ describe("wrangler", () => {
64
63
 
65
64
  expect(std.out).toMatchInlineSnapshot(`
66
65
  "
67
- "
68
- `);
69
- expect(std.err).toMatchInlineSnapshot(`
70
- "wrangler
66
+ wrangler
71
67
 
72
68
  Commands:
73
69
  wrangler init [name] 📥 Create a wrangler.toml configuration file
@@ -85,11 +81,12 @@ describe("wrangler", () => {
85
81
  wrangler whoami 🕵️ Retrieve your user info and test your auth config
86
82
 
87
83
  Flags:
88
- -c, --config Path to .toml configuration file [string]
89
- -h, --help Show help [boolean]
90
- -v, --version Show version number [boolean]
91
- --legacy-env Use legacy environments [boolean]
92
- X [ERROR] Unknown argument: invalid-command
84
+ -c, --config Path to .toml configuration file [string]
85
+ -h, --help Show help [boolean]
86
+ -v, --version Show version number [boolean]"
87
+ `);
88
+ expect(std.err).toMatchInlineSnapshot(`
89
+ "X [ERROR] Unknown argument: invalid-command
93
90
 
94
91
  "
95
92
  `);
@@ -133,10 +130,9 @@ describe("wrangler", () => {
133
130
  wrangler secret list List all secrets for a script
134
131
 
135
132
  Flags:
136
- -c, --config Path to .toml configuration file [string]
137
- -h, --help Show help [boolean]
138
- -v, --version Show version number [boolean]
139
- --legacy-env Use legacy environments [boolean]"
133
+ -c, --config Path to .toml configuration file [string]
134
+ -h, --help Show help [boolean]
135
+ -v, --version Show version number [boolean]"
140
136
  `);
141
137
  });
142
138
 
@@ -144,20 +140,19 @@ describe("wrangler", () => {
144
140
  await runWrangler("kv:namespace");
145
141
  await endEventLoop();
146
142
  expect(std.out).toMatchInlineSnapshot(`
147
- "wrangler kv:namespace
143
+ "wrangler kv:namespace
148
144
 
149
- 🗂️ Interact with your Workers KV Namespaces
145
+ 🗂️ Interact with your Workers KV Namespaces
150
146
 
151
- Commands:
152
- wrangler kv:namespace create <namespace> Create a new namespace
153
- wrangler kv:namespace list Outputs a list of all KV namespaces associated with your account id.
154
- wrangler kv:namespace delete Deletes a given namespace.
147
+ Commands:
148
+ wrangler kv:namespace create <namespace> Create a new namespace
149
+ wrangler kv:namespace list Outputs a list of all KV namespaces associated with your account id.
150
+ wrangler kv:namespace delete Deletes a given namespace.
155
151
 
156
- Flags:
157
- -c, --config Path to .toml configuration file [string]
158
- -h, --help Show help [boolean]
159
- -v, --version Show version number [boolean]
160
- --legacy-env Use legacy environments [boolean]"
152
+ Flags:
153
+ -c, --config Path to .toml configuration file [string]
154
+ -h, --help Show help [boolean]
155
+ -v, --version Show version number [boolean]"
161
156
  `);
162
157
  });
163
158
 
@@ -165,60 +160,57 @@ describe("wrangler", () => {
165
160
  await runWrangler("kv:key");
166
161
  await endEventLoop();
167
162
  expect(std.out).toMatchInlineSnapshot(`
168
- "wrangler kv:key
163
+ "wrangler kv:key
169
164
 
170
- 🔑 Individually manage Workers KV key-value pairs
165
+ 🔑 Individually manage Workers KV key-value pairs
171
166
 
172
- Commands:
173
- wrangler kv:key put <key> [value] Writes a single key/value pair to the given namespace.
174
- wrangler kv:key list Outputs a list of all keys in a given namespace.
175
- wrangler kv:key get <key> Reads a single value by key from the given namespace.
176
- wrangler kv:key delete <key> Removes a single key value pair from the given namespace.
167
+ Commands:
168
+ wrangler kv:key put <key> [value] Writes a single key/value pair to the given namespace.
169
+ wrangler kv:key list Outputs a list of all keys in a given namespace.
170
+ wrangler kv:key get <key> Reads a single value by key from the given namespace.
171
+ wrangler kv:key delete <key> Removes a single key value pair from the given namespace.
177
172
 
178
- Flags:
179
- -c, --config Path to .toml configuration file [string]
180
- -h, --help Show help [boolean]
181
- -v, --version Show version number [boolean]
182
- --legacy-env Use legacy environments [boolean]"
183
- `);
173
+ Flags:
174
+ -c, --config Path to .toml configuration file [string]
175
+ -h, --help Show help [boolean]
176
+ -v, --version Show version number [boolean]"
177
+ `);
184
178
  });
185
179
 
186
180
  it("no subcommand 'kv:bulk' should display a list of available subcommands", async () => {
187
181
  await runWrangler("kv:bulk");
188
182
  await endEventLoop();
189
183
  expect(std.out).toMatchInlineSnapshot(`
190
- "wrangler kv:bulk
184
+ "wrangler kv:bulk
191
185
 
192
- 💪 Interact with multiple Workers KV key-value pairs at once
186
+ 💪 Interact with multiple Workers KV key-value pairs at once
193
187
 
194
- Commands:
195
- wrangler kv:bulk put <filename> Upload multiple key-value pairs to a namespace
196
- wrangler kv:bulk delete <filename> Delete multiple key-value pairs from a namespace
188
+ Commands:
189
+ wrangler kv:bulk put <filename> Upload multiple key-value pairs to a namespace
190
+ wrangler kv:bulk delete <filename> Delete multiple key-value pairs from a namespace
197
191
 
198
- Flags:
199
- -c, --config Path to .toml configuration file [string]
200
- -h, --help Show help [boolean]
201
- -v, --version Show version number [boolean]
202
- --legacy-env Use legacy environments [boolean]"
203
- `);
192
+ Flags:
193
+ -c, --config Path to .toml configuration file [string]
194
+ -h, --help Show help [boolean]
195
+ -v, --version Show version number [boolean]"
196
+ `);
204
197
  });
205
198
  it("no subcommand 'r2' should display a list of available subcommands", async () => {
206
199
  await runWrangler("r2");
207
200
  await endEventLoop();
208
201
  expect(std.out).toMatchInlineSnapshot(`
209
- "wrangler r2
202
+ "wrangler r2
210
203
 
211
- 📦 Interact with an R2 store
204
+ 📦 Interact with an R2 store
212
205
 
213
- Commands:
214
- wrangler r2 bucket Manage R2 buckets
206
+ Commands:
207
+ wrangler r2 bucket Manage R2 buckets
215
208
 
216
- Flags:
217
- -c, --config Path to .toml configuration file [string]
218
- -h, --help Show help [boolean]
219
- -v, --version Show version number [boolean]
220
- --legacy-env Use legacy environments [boolean]"
221
- `);
209
+ Flags:
210
+ -c, --config Path to .toml configuration file [string]
211
+ -h, --help Show help [boolean]
212
+ -v, --version Show version number [boolean]"
213
+ `);
222
214
  });
223
215
  });
224
216
  describe("Deprecated commands", () => {
@@ -241,7 +233,7 @@ describe("wrangler", () => {
241
233
  await runWrangler("build").catch((err) => {
242
234
  expect(err.message).toMatchInlineSnapshot(`
243
235
  "Deprecation:
244
- \`wrangler build\` has been deprecated, please refer to https://github.com/cloudflare/wrangler2/blob/main/docs/deprecations.md#build for alternatives"
236
+ \`wrangler build\` has been deprecated, please refer to https://developers.cloudflare.com/workers/wrangler/migration/deprecations/#build for alternatives"
245
237
  `);
246
238
  });
247
239
  });
@@ -8,6 +8,14 @@ import { confirm, prompt } from "../dialogs";
8
8
  import { mockFetchInternal, mockFetchKVGetValue } from "./helpers/mock-cfetch";
9
9
  import { MockWebSocket } from "./helpers/mock-web-socket";
10
10
 
11
+ // Mock out getPort since we don't actually care about what ports are open in unit tests.
12
+ jest.mock("get-port", () => {
13
+ return {
14
+ __esModule: true,
15
+ default: jest.fn().mockImplementation(async (options) => options.port),
16
+ };
17
+ });
18
+
11
19
  jest.mock("ws", () => {
12
20
  return {
13
21
  __esModule: true,