You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it("should successfully rollback and output a success message",async()=>{
276
-
mockConfirm({
277
-
text: "This deployment 3mEgaU1T will immediately replace the current deployment and become the active deployment across all your deployed routes and domains. However, your local development environment will not be affected by this rollback. Note: Rolling back to a previous deployment will not rollback any of the bound resources (Durable Object, D1, R2, KV, etc).",
278
-
result: true,
279
-
});
280
-
281
-
mockPrompt({
282
-
text: "Please provide a message for this rollback (120 characters max)",
Successfully rolled back to Deployment ID: 3mEgaU1T-Intrepid-someThing-tag:test-name
293
-
Current Version ID: galactic_mission_alpha"
294
-
`);
295
-
296
-
expect(requests.count).toEqual(1);
297
-
});
298
-
299
-
it("should early exit from rollback if user denies continuing",async()=>{
300
-
mockConfirm({
301
-
text: "This deployment 3mEgaU1T will immediately replace the current deployment and become the active deployment across all your deployed routes and domains. However, your local development environment will not be affected by this rollback. Note: Rolling back to a previous deployment will not rollback any of the bound resources (Durable Object, D1, R2, KV, etc).",
"? This deployment 3mEgaU1T will immediately replace the current deployment and become the active deployment across all your deployed routes and domains. However, your local development environment will not be affected by this rollback. Note: Rolling back to a previous deployment will not rollback any of the bound resources (Durable Object, D1, R2, KV, etc).
323
-
🤖 Using fallback value in non-interactive context: yes
324
-
? Please provide a message for this rollback (120 characters max)
325
-
🤖 Using default value in non-interactive context:
326
-
327
-
Successfully rolled back to Deployment ID: 3mEgaU1T-Intrepid-someThing-tag:test-name
328
-
Current Version ID: galactic_mission_alpha"
329
-
`);
330
-
331
-
expect(requests.count).toEqual(1);
332
-
});
333
-
334
-
it("should skip prompt automatically in rollback if message flag is provided",async()=>{
Successfully rolled back to Deployment ID: 3mEgaU1T-Intrepid-someThing-tag:test-name
356
-
Current Version ID: galactic_mission_alpha"
357
-
`);
358
-
359
-
expect(requests.count).toEqual(1);
360
-
});
361
-
362
-
it("should automatically rollback to previous deployment when id is not specified",async()=>{
363
-
mockConfirm({
364
-
text: "This deployment 3mEgaU1T will immediately replace the current deployment and become the active deployment across all your deployed routes and domains. However, your local development environment will not be affected by this rollback. Note: Rolling back to a previous deployment will not rollback any of the bound resources (Durable Object, D1, R2, KV, etc).",
365
-
result: true,
366
-
});
367
-
368
-
mockPrompt({
369
-
text: "Please provide a message for this rollback (120 characters max)",
370
-
result: "",
371
-
});
372
-
373
-
writeWranglerConfig();
374
-
awaitrunWrangler("rollback --no-x-versions");
375
-
expect(std.out).toMatchInlineSnapshot(`
376
-
"
377
-
Successfully rolled back to Deployment ID: 3mEgaU1T-Intrepid-someThing-tag:test-name
`[Error: You need to provide a name for your Worker. Either pass it as a cli arg with \`--name <name>\` or in your configuration file as \`name = "<name>"\`]`
387
-
);
388
-
389
-
expect(requests.count).toEqual(0);
390
-
});
391
-
392
-
it("should automatically rollback to previous deployment with specified name",async()=>{
393
-
mockConfirm({
394
-
text: "This deployment 3mEgaU1T will immediately replace the current deployment and become the active deployment across all your deployed routes and domains. However, your local development environment will not be affected by this rollback. Note: Rolling back to a previous deployment will not rollback any of the bound resources (Durable Object, D1, R2, KV, etc).",
395
-
result: true,
396
-
});
397
-
398
-
mockPrompt({
399
-
text: "Please provide a message for this rollback (120 characters max)",
`[Error: You need to provide a name for your Worker. Either pass it as a cli arg with \`--name <name>\` or in your configuration file as \`name = "<name>"\`]`
`[Error: You need to provide a name for your Worker. Either pass it as a cli arg with \`--name <name>\` or in your configuration file as \`name = "<name>"\`]`
0 commit comments