From 14c4b0b288b5df639198219c408b8a969657bf70 Mon Sep 17 00:00:00 2001 From: Edmund Hung Date: Fri, 3 Oct 2025 15:54:58 +0100 Subject: [PATCH 1/5] chore: stop mocking wrangler banner by default --- .../__tests__/__snapshots__/kv.test.ts.snap | 50 +- .../__tests__/__snapshots__/r2.test.ts.snap | 40 +- packages/wrangler/src/__tests__/ai.test.ts | 20 +- packages/wrangler/src/__tests__/cert.test.ts | 47 +- .../src/__tests__/cfetch-utils.test.ts | 5 +- .../src/__tests__/cloudchamber/images.test.ts | 5 - .../src/__tests__/containers/deploy.test.ts | 100 +- .../wrangler/src/__tests__/d1/create.test.ts | 5 +- .../wrangler/src/__tests__/d1/execute.test.ts | 4 - .../wrangler/src/__tests__/d1/info.test.ts | 3 - .../wrangler/src/__tests__/d1/list.test.ts | 3 - .../src/__tests__/d1/timeTravel.test.ts | 4 - .../wrangler/src/__tests__/delete.test.ts | 213 ++-- .../wrangler/src/__tests__/deploy.test.ts | 1102 +++++++++++++---- packages/wrangler/src/__tests__/dev.test.ts | 52 +- packages/wrangler/src/__tests__/docs.test.ts | 15 +- .../src/__tests__/hello-world.local.test.ts | 24 +- .../wrangler/src/__tests__/hyperdrive.test.ts | 160 ++- packages/wrangler/src/__tests__/index.test.ts | 5 +- packages/wrangler/src/__tests__/init.test.ts | 29 +- .../wrangler/src/__tests__/kv.local.test.ts | 121 +- packages/wrangler/src/__tests__/kv.test.ts | 157 ++- .../wrangler/src/__tests__/logout.test.ts | 28 +- .../wrangler/src/__tests__/metrics.test.ts | 17 +- .../src/__tests__/mtls-certificates.test.ts | 47 +- .../pages/__snapshots__/deploy.test.ts.snap | 20 +- .../src/__tests__/pages/deploy.test.ts | 100 +- .../__tests__/pages/deployment-list.test.ts | 1 - .../__tests__/pages/functions-build.test.ts | 82 +- .../__tests__/pages/pages-build-env.test.ts | 55 +- .../pages/pages-deployment-tail.test.ts | 2 - .../pages/pages-download-config.test.ts | 13 +- .../src/__tests__/pages/pages.test.ts | 21 +- .../__tests__/pages/project-create.test.ts | 27 +- .../__tests__/pages/project-delete.test.ts | 24 +- .../__tests__/pages/project-upload.test.ts | 45 +- .../__tests__/pages/project-validate.test.ts | 6 +- .../src/__tests__/pages/secret.test.ts | 122 +- .../wrangler/src/__tests__/pipelines.test.ts | 2 - .../wrangler/src/__tests__/provision.test.ts | 55 +- .../queues/queues-subscription.test.ts | 1 - .../src/__tests__/queues/queues.test.ts | 1 - .../wrangler/src/__tests__/r2.local.test.ts | 52 +- packages/wrangler/src/__tests__/r2.test.ts | 513 +++++--- .../wrangler/src/__tests__/r2/bucket.test.ts | 2 - .../wrangler/src/__tests__/r2/pipe.test.ts | 1 - .../wrangler/src/__tests__/secret.test.ts | 2 - .../src/__tests__/secrets-store.test.ts | 46 +- .../wrangler/src/__tests__/sentry.test.ts | 48 +- packages/wrangler/src/__tests__/tail.test.ts | 4 - .../src/__tests__/type-generation.test.ts | 111 +- packages/wrangler/src/__tests__/user.test.ts | 25 +- .../src/__tests__/vectorize/vectorize.test.ts | 343 ++++- .../vectorize/vectorize.upsert.test.ts | 33 +- .../__tests__/versions/secrets/bulk.test.ts | 39 +- .../__tests__/versions/secrets/delete.test.ts | 15 +- .../__tests__/versions/secrets/list.test.ts | 20 +- .../__tests__/versions/secrets/put.test.ts | 50 +- .../__tests__/versions/versions.list.test.ts | 2 - .../versions/versions.upload.test.ts | 30 +- .../__tests__/versions/versions.view.test.ts | 2 - .../wrangler/src/__tests__/vitest.setup.ts | 1 - packages/wrangler/src/__tests__/vpc.test.ts | 30 +- .../wrangler/src/__tests__/whoami.test.ts | 10 +- .../src/__tests__/worker-namespace.test.ts | 67 +- .../wrangler/src/__tests__/workflows.test.ts | 25 +- 66 files changed, 3292 insertions(+), 1012 deletions(-) diff --git a/packages/wrangler/src/__tests__/__snapshots__/kv.test.ts.snap b/packages/wrangler/src/__tests__/__snapshots__/kv.test.ts.snap index 1ee0f06024..b83e8c8725 100644 --- a/packages/wrangler/src/__tests__/__snapshots__/kv.test.ts.snap +++ b/packages/wrangler/src/__tests__/__snapshots__/kv.test.ts.snap @@ -1,7 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`wrangler > kv namespace > create > wrangler.json > should create a namespace 1`] = ` -"Resource location: remote +" + ⛅️ wrangler x.x.x +────────────────── +Resource location: remote 🌀 Creating namespace with title \\"UnitTestNamespace\\" ✨ Success! 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 `; exports[`wrangler > kv namespace > create > wrangler.json > should create a namespace in an environment if configured to do so 1`] = ` -"Resource location: remote +" + ⛅️ wrangler x.x.x +────────────────── +Resource location: remote 🌀 Creating namespace with title \\"customEnv-UnitTestNamespace\\" ✨ Success! 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 `; exports[`wrangler > kv namespace > create > wrangler.json > should create a namespace using configured worker name 1`] = ` -"Resource location: remote +" + ⛅️ wrangler x.x.x +────────────────── +Resource location: remote 🌀 Creating namespace with title \\"UnitTestNamespace\\" ✨ Success! 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 `; exports[`wrangler > kv namespace > create > wrangler.json > should create a namespace with custom binding name 1`] = ` -"Resource location: remote +" + ⛅️ wrangler x.x.x +────────────────── +Resource location: remote 🌀 Creating namespace with title \\"UnitTestNamespace\\" ✨ Success! 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 `; exports[`wrangler > kv namespace > create > wrangler.json > should create a preview namespace if configured to do so 1`] = ` -"Resource location: remote +" + ⛅️ wrangler x.x.x +────────────────── +Resource location: remote 🌀 Creating namespace with title \\"UnitTestNamespace_preview\\" ✨ Success! 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 `; exports[`wrangler > kv namespace > create > wrangler.toml > should create a namespace 1`] = ` -"Resource location: remote +" + ⛅️ wrangler x.x.x +────────────────── +Resource location: remote 🌀 Creating namespace with title \\"UnitTestNamespace\\" ✨ Success! To access your new KV Namespace in your Worker, add the following snippet to your configuration file: @@ -154,7 +172,10 @@ name = \\"worker\\" `; exports[`wrangler > kv namespace > create > wrangler.toml > should create a namespace in an environment if configured to do so 1`] = ` -"Resource location: remote +" + ⛅️ wrangler x.x.x +────────────────── +Resource location: remote 🌀 Creating namespace with title \\"customEnv-UnitTestNamespace\\" ✨ Success! 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\\" `; exports[`wrangler > kv namespace > create > wrangler.toml > should create a namespace using configured worker name 1`] = ` -"Resource location: remote +" + ⛅️ wrangler x.x.x +────────────────── +Resource location: remote 🌀 Creating namespace with title \\"UnitTestNamespace\\" ✨ Success! To access your new KV Namespace in your Worker, add the following snippet to your configuration file: @@ -192,7 +216,10 @@ name = \\"other-worker\\" `; exports[`wrangler > kv namespace > create > wrangler.toml > should create a namespace with custom binding name 1`] = ` -"Resource location: remote +" + ⛅️ wrangler x.x.x +────────────────── +Resource location: remote 🌀 Creating namespace with title \\"UnitTestNamespace\\" ✨ Success! To access your new KV Namespace in your Worker, add the following snippet to your configuration file: @@ -209,7 +236,10 @@ name = \\"worker\\" `; exports[`wrangler > kv namespace > create > wrangler.toml > should create a preview namespace if configured to do so 1`] = ` -"Resource location: remote +" + ⛅️ wrangler x.x.x +────────────────── +Resource location: remote 🌀 Creating namespace with title \\"UnitTestNamespace_preview\\" ✨ Success! To access your new KV Namespace in your Worker, add the following snippet to your configuration file: diff --git a/packages/wrangler/src/__tests__/__snapshots__/r2.test.ts.snap b/packages/wrangler/src/__tests__/__snapshots__/r2.test.ts.snap index d4a259db16..e0005e8b31 100644 --- a/packages/wrangler/src/__tests__/__snapshots__/r2.test.ts.snap +++ b/packages/wrangler/src/__tests__/__snapshots__/r2.test.ts.snap @@ -1,7 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`r2 > bucket > create > wrangler.json > should create a bucket & check request inputs 1`] = ` -"Creating bucket 'test-bucket'... +" + ⛅️ wrangler x.x.x +────────────────── +Creating bucket 'test-bucket'... ✅ Created bucket 'test-bucket' with default storage class of Standard. To access your new R2 Bucket in your Worker, add the following snippet to your configuration file: { @@ -17,7 +20,10 @@ To access your new R2 Bucket in your Worker, add the following snippet to your c `; exports[`r2 > bucket > create > wrangler.json > should create a bucket with the expected default storage class 1`] = ` -"Creating bucket 'test-bucket'... +" + ⛅️ wrangler x.x.x +────────────────── +Creating bucket 'test-bucket'... ✅ Created bucket 'test-bucket' with default storage class of InfrequentAccess. To access your new R2 Bucket in your Worker, add the following snippet to your configuration file: { @@ -33,7 +39,10 @@ To access your new R2 Bucket in your Worker, add the following snippet to your c `; exports[`r2 > bucket > create > wrangler.json > should create a bucket with the expected jurisdiction 1`] = ` -"Creating bucket 'test-bucket (eu)'... +" + ⛅️ wrangler x.x.x +────────────────── +Creating bucket 'test-bucket (eu)'... ✅ Created bucket 'test-bucket (eu)' with default storage class of Standard. To access your new R2 Bucket in your Worker, add the following snippet to your configuration file: { @@ -49,7 +58,10 @@ To access your new R2 Bucket in your Worker, add the following snippet to your c `; exports[`r2 > bucket > create > wrangler.json > should create a bucket with the expected location hint 1`] = ` -"Creating bucket 'test-bucket'... +" + ⛅️ wrangler x.x.x +────────────────── +Creating bucket 'test-bucket'... ✅ Created bucket 'test-bucket' with location hint weur and default storage class of Standard. To access your new R2 Bucket in your Worker, add the following snippet to your configuration file: { @@ -65,7 +77,10 @@ To access your new R2 Bucket in your Worker, add the following snippet to your c `; exports[`r2 > bucket > create > wrangler.toml > should create a bucket & check request inputs 1`] = ` -"Creating bucket 'test-bucket'... +" + ⛅️ wrangler x.x.x +────────────────── +Creating bucket 'test-bucket'... ✅ Created bucket 'test-bucket' with default storage class of Standard. To access your new R2 Bucket in your Worker, add the following snippet to your configuration file: [[r2_buckets]] @@ -75,7 +90,10 @@ binding = \\"test_bucket\\" `; exports[`r2 > bucket > create > wrangler.toml > should create a bucket with the expected default storage class 1`] = ` -"Creating bucket 'test-bucket'... +" + ⛅️ wrangler x.x.x +────────────────── +Creating bucket 'test-bucket'... ✅ Created bucket 'test-bucket' with default storage class of InfrequentAccess. To access your new R2 Bucket in your Worker, add the following snippet to your configuration file: [[r2_buckets]] @@ -85,7 +103,10 @@ binding = \\"test_bucket\\" `; exports[`r2 > bucket > create > wrangler.toml > should create a bucket with the expected jurisdiction 1`] = ` -"Creating bucket 'test-bucket (eu)'... +" + ⛅️ wrangler x.x.x +────────────────── +Creating bucket 'test-bucket (eu)'... ✅ Created bucket 'test-bucket (eu)' with default storage class of Standard. To access your new R2 Bucket in your Worker, add the following snippet to your configuration file: [[r2_buckets]] @@ -95,7 +116,10 @@ binding = \\"test_bucket\\" `; exports[`r2 > bucket > create > wrangler.toml > should create a bucket with the expected location hint 1`] = ` -"Creating bucket 'test-bucket'... +" + ⛅️ wrangler x.x.x +────────────────── +Creating bucket 'test-bucket'... ✅ Created bucket 'test-bucket' with location hint weur and default storage class of Standard. To access your new R2 Bucket in your Worker, add the following snippet to your configuration file: [[r2_buckets]] diff --git a/packages/wrangler/src/__tests__/ai.test.ts b/packages/wrangler/src/__tests__/ai.test.ts index 17f270b9b0..a68d3d137d 100644 --- a/packages/wrangler/src/__tests__/ai.test.ts +++ b/packages/wrangler/src/__tests__/ai.test.ts @@ -86,7 +86,10 @@ describe("ai commands", () => { mockAIListFinetuneRequest(); await runWrangler("ai finetune list"); expect(std.out).toMatchInlineSnapshot(` - "┌─┬─┬─┐ + " + ⛅️ wrangler x.x.x + ────────────────── + ┌─┬─┬─┐ │ finetune_id │ name │ description │ ├─┼─┼─┤ │ 4d73459a-0000-4688-0000-b19fbb0e0fa5 │ instruct-demo1 │ │ @@ -108,7 +111,10 @@ describe("ai commands", () => { mockAISearchRequest(); await runWrangler("ai models"); expect(std.out).toMatchInlineSnapshot(` - "┌─┬─┬─┬─┐ + " + ⛅️ wrangler x.x.x + ────────────────── + ┌─┬─┬─┬─┐ │ model │ name │ description │ task │ ├─┼─┼─┼─┤ │ 429b9e8b-d99e-44de-91ad-706cf8183658 │ @cloudflare/embeddings_bge_large_en │ │ │ @@ -126,7 +132,10 @@ describe("ai commands", () => { mockAIOverflowRequest(); await runWrangler("ai models"); expect(std.out).toMatchInlineSnapshot(` - "┌─┬─┬─┬─┐ + " + ⛅️ wrangler x.x.x + ────────────────── + ┌─┬─┬─┬─┐ │ model │ name │ description │ task │ ├─┼─┼─┼─┤ │ 429b9e8b-d99e-44de-91ad-706cf8183658 │ @cloudflare/embeddings_bge_large_en │ │ │ @@ -144,7 +153,10 @@ describe("ai commands", () => { mockAIPaginatedRequest(); await runWrangler("ai models"); expect(std.out).toMatchInlineSnapshot(` - "┌─┬─┬─┬─┐ + " + ⛅️ wrangler x.x.x + ────────────────── + ┌─┬─┬─┬─┐ │ model │ name │ description │ task │ ├─┼─┼─┼─┤ │ 429b9e8b-d99e-44de-91ad-706cf8183658 │ @cloudflare/embeddings_bge_large_en │ │ │ diff --git a/packages/wrangler/src/__tests__/cert.test.ts b/packages/wrangler/src/__tests__/cert.test.ts index 702e1b2697..314220c976 100644 --- a/packages/wrangler/src/__tests__/cert.test.ts +++ b/packages/wrangler/src/__tests__/cert.test.ts @@ -609,7 +609,11 @@ Expires on: ${oneYearLater.toLocaleDateString()} " `); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ──────────────────" + `); }); it("should require not providing --id and --name", async () => { @@ -620,7 +624,11 @@ Expires on: ${oneYearLater.toLocaleDateString()} " `); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ──────────────────" + `); }); it("should delete certificate by id", async () => { @@ -636,7 +644,12 @@ Expires on: ${oneYearLater.toLocaleDateString()} expect(std.err).toMatchInlineSnapshot(`""`); expect(std.out).toMatchInlineSnapshot( - `"Deleted certificate 1234 (my-cert) successfully"` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Deleted certificate 1234 (my-cert) successfully" + ` ); }); @@ -653,7 +666,12 @@ Expires on: ${oneYearLater.toLocaleDateString()} expect(std.err).toMatchInlineSnapshot(`""`); expect(std.out).toMatchInlineSnapshot( - `"Deleted certificate 1234 (my-cert) successfully"` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Deleted certificate 1234 (my-cert) successfully" + ` ); }); @@ -665,7 +683,12 @@ Expires on: ${oneYearLater.toLocaleDateString()} ).rejects.toMatchInlineSnapshot( `[Error: certificate not found with name "my-cert"]` ); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); }); it("should not delete when many certificates are found by name", async () => { @@ -693,7 +716,12 @@ Expires on: ${oneYearLater.toLocaleDateString()} ).rejects.toMatchInlineSnapshot( `[Error: multiple certificates found with name "my-cert"]` ); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); }); it("should not delete when confirmation fails", async () => { @@ -706,7 +734,12 @@ Expires on: ${oneYearLater.toLocaleDateString()} await runWrangler("cert delete --id 1234"); expect(std.err).toMatchInlineSnapshot(`""`); - expect(std.out).toMatchInlineSnapshot(`"Not deleting"`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + Not deleting" + `); }); }); }); diff --git a/packages/wrangler/src/__tests__/cfetch-utils.test.ts b/packages/wrangler/src/__tests__/cfetch-utils.test.ts index d6dddf5714..73885724bb 100644 --- a/packages/wrangler/src/__tests__/cfetch-utils.test.ts +++ b/packages/wrangler/src/__tests__/cfetch-utils.test.ts @@ -171,7 +171,10 @@ describe("throwFetchError", () => { ", "info": "", - "out": "Getting User settings... + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Getting User settings... ", "warn": "", } diff --git a/packages/wrangler/src/__tests__/cloudchamber/images.test.ts b/packages/wrangler/src/__tests__/cloudchamber/images.test.ts index 291814f750..dd3821ded0 100644 --- a/packages/wrangler/src/__tests__/cloudchamber/images.test.ts +++ b/packages/wrangler/src/__tests__/cloudchamber/images.test.ts @@ -1,7 +1,6 @@ import { getCloudflareContainerRegistry } from "@cloudflare/containers-shared"; import { http, HttpResponse } from "msw"; import patchConsole from "patch-console"; -import { vi } from "vitest"; import { mockAccountId, mockApiToken } from "../helpers/mock-account-id"; import { mockConsoleMethods } from "../helpers/mock-console"; import { useMockIsTTY } from "../helpers/mock-istty"; @@ -10,10 +9,6 @@ import { runInTempDir } from "../helpers/run-in-tmp"; import { runWrangler } from "../helpers/run-wrangler"; import { mockAccount, setWranglerConfig } from "./utils"; -// we want to include the banner to make sure it doesn't show up in the output -// when using --json -vi.unmock("../wrangler-banner"); - describe("cloudchamber image", () => { const std = mockConsoleMethods(); const { setIsTTY } = useMockIsTTY(); diff --git a/packages/wrangler/src/__tests__/containers/deploy.test.ts b/packages/wrangler/src/__tests__/containers/deploy.test.ts index ca2ad66715..8fb593d930 100644 --- a/packages/wrangler/src/__tests__/containers/deploy.test.ts +++ b/packages/wrangler/src/__tests__/containers/deploy.test.ts @@ -112,7 +112,10 @@ describe("wrangler deploy with containers", () => { await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -184,17 +187,20 @@ describe("wrangler deploy with containers", () => { await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB - Worker Startup Time: 100 ms - Your Worker has access to the following bindings: - Binding Resource - env.EXAMPLE_DO_BINDING (ExampleDurableObject) Durable Object - - Uploaded test-name (TIMINGS) - Deployed test-name triggers (TIMINGS) - https://test-name.test-sub-domain.workers.dev - Current Version ID: Galaxy-Class" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB + Worker Startup Time: 100 ms + Your Worker has access to the following bindings: + Binding Resource + env.EXAMPLE_DO_BINDING (ExampleDurableObject) Durable Object + + Uploaded test-name (TIMINGS) + Deployed test-name triggers (TIMINGS) + https://test-name.test-sub-domain.workers.dev + Current Version ID: Galaxy-Class" + `); expect(std.err).toMatchInlineSnapshot(`""`); expect(std.warn).toMatchInlineSnapshot(`""`); expect(cliStd.stdout).toMatchInlineSnapshot(` @@ -267,17 +273,20 @@ describe("wrangler deploy with containers", () => { await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB - Worker Startup Time: 100 ms - Your Worker has access to the following bindings: - Binding Resource - env.EXAMPLE_DO_BINDING (ExampleDurableObject) Durable Object - - Uploaded test-name (TIMINGS) - Deployed test-name triggers (TIMINGS) - https://test-name.test-sub-domain.workers.dev - Current Version ID: Galaxy-Class" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB + Worker Startup Time: 100 ms + Your Worker has access to the following bindings: + Binding Resource + env.EXAMPLE_DO_BINDING (ExampleDurableObject) Durable Object + + Uploaded test-name (TIMINGS) + Deployed test-name triggers (TIMINGS) + https://test-name.test-sub-domain.workers.dev + Current Version ID: Galaxy-Class" + `); expect(std.warn).toMatchInlineSnapshot(` "▲ [WARNING] Processing wrangler.toml configuration: @@ -362,17 +371,20 @@ describe("wrangler deploy with containers", () => { await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB - Worker Startup Time: 100 ms - Your Worker has access to the following bindings: - Binding Resource - env.EXAMPLE_DO_BINDING (ExampleDurableObject) Durable Object - - Uploaded test-name (TIMINGS) - Deployed test-name triggers (TIMINGS) - https://test-name.test-sub-domain.workers.dev - Current Version ID: Galaxy-Class" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB + Worker Startup Time: 100 ms + Your Worker has access to the following bindings: + Binding Resource + env.EXAMPLE_DO_BINDING (ExampleDurableObject) Durable Object + + Uploaded test-name (TIMINGS) + Deployed test-name triggers (TIMINGS) + https://test-name.test-sub-domain.workers.dev + Current Version ID: Galaxy-Class" + `); // no deprecation warnings should show up on this run expect(std.warn).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(`""`); @@ -459,7 +471,10 @@ describe("wrangler deploy with containers", () => { await runWrangler("deploy --cwd src"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -519,7 +534,10 @@ describe("wrangler deploy with containers", () => { await runWrangler("deploy -c nested/wrangler.json"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -1692,7 +1710,10 @@ describe("wrangler deploy with containers dry run", () => { await runWrangler("deploy --dry-run index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Building image my-container:worker Your Worker has access to the following bindings: Binding Resource @@ -1717,7 +1738,10 @@ describe("wrangler deploy with containers dry run", () => { await runWrangler("deploy --dry-run index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Your Worker has access to the following bindings: Binding Resource env.EXAMPLE_DO_BINDING (ExampleDurableObject) Durable Object diff --git a/packages/wrangler/src/__tests__/d1/create.test.ts b/packages/wrangler/src/__tests__/d1/create.test.ts index 2f66be2b00..7f2c1df06a 100644 --- a/packages/wrangler/src/__tests__/d1/create.test.ts +++ b/packages/wrangler/src/__tests__/d1/create.test.ts @@ -64,7 +64,10 @@ describe("create", () => { ); await runWrangler("d1 create test --location oc --binding MY_TEST_DB"); expect(std.out).toMatchInlineSnapshot(` - "✅ Successfully created DB 'test' in region OC + " + ⛅️ wrangler x.x.x + ────────────────── + ✅ Successfully created DB 'test' in region OC Created your new D1 database. To access your new D1 Database in your Worker, add the following snippet to your configuration file: diff --git a/packages/wrangler/src/__tests__/d1/execute.test.ts b/packages/wrangler/src/__tests__/d1/execute.test.ts index 28dbec6fdb..ac9c54ab5d 100644 --- a/packages/wrangler/src/__tests__/d1/execute.test.ts +++ b/packages/wrangler/src/__tests__/d1/execute.test.ts @@ -6,10 +6,6 @@ import { runInTempDir } from "../helpers/run-in-tmp"; import { runWrangler } from "../helpers/run-wrangler"; import { writeWranglerConfig } from "../helpers/write-wrangler-config"; -// we want to include the banner to make sure it doesn't show up in the output -// when --json=true -vi.unmock("../../wrangler-banner"); - describe("execute", () => { const std = mockConsoleMethods(); runInTempDir(); diff --git a/packages/wrangler/src/__tests__/d1/info.test.ts b/packages/wrangler/src/__tests__/d1/info.test.ts index 86c6b13ab6..e5504789c5 100644 --- a/packages/wrangler/src/__tests__/d1/info.test.ts +++ b/packages/wrangler/src/__tests__/d1/info.test.ts @@ -8,9 +8,6 @@ import { runInTempDir } from "../helpers/run-in-tmp"; import { runWrangler } from "../helpers/run-wrangler"; import { writeWranglerConfig } from "../helpers/write-wrangler-config"; -// we want to include the banner to make sure it doesn't show up in the output when -// when --json=true -vi.unmock("../../wrangler-banner"); describe("info", () => { mockAccountId({ accountId: null }); mockApiToken(); diff --git a/packages/wrangler/src/__tests__/d1/list.test.ts b/packages/wrangler/src/__tests__/d1/list.test.ts index 1f2c17e31e..b4c7cf3d41 100644 --- a/packages/wrangler/src/__tests__/d1/list.test.ts +++ b/packages/wrangler/src/__tests__/d1/list.test.ts @@ -7,9 +7,6 @@ import { msw } from "../helpers/msw"; import { runInTempDir } from "../helpers/run-in-tmp"; import { runWrangler } from "../helpers/run-wrangler"; -// we want to include the banner to make sure it doesn't show up in the output when -// when --json=true -vi.unmock("../../wrangler-banner"); describe("list", () => { mockAccountId({ accountId: null }); mockApiToken(); diff --git a/packages/wrangler/src/__tests__/d1/timeTravel.test.ts b/packages/wrangler/src/__tests__/d1/timeTravel.test.ts index 491e1ec1be..8b4b1c7349 100644 --- a/packages/wrangler/src/__tests__/d1/timeTravel.test.ts +++ b/packages/wrangler/src/__tests__/d1/timeTravel.test.ts @@ -10,10 +10,6 @@ import { runInTempDir } from "../helpers/run-in-tmp"; import { runWrangler } from "../helpers/run-wrangler"; import { writeWranglerConfig } from "../helpers/write-wrangler-config"; -// we want to include the banner to make sure it doesn't show up in the output when -// when --json=true -vi.unmock("../../wrangler-banner"); - describe("time-travel", () => { const std = mockConsoleMethods(); mockAccountId({ accountId: null }); diff --git a/packages/wrangler/src/__tests__/delete.test.ts b/packages/wrangler/src/__tests__/delete.test.ts index e07c04e187..9e694030df 100644 --- a/packages/wrangler/src/__tests__/delete.test.ts +++ b/packages/wrangler/src/__tests__/delete.test.ts @@ -32,14 +32,17 @@ describe("delete", () => { await runWrangler("delete --name my-script"); expect(std).toMatchInlineSnapshot(` - Object { - "debug": "", - "err": "", - "info": "", - "out": "Successfully deleted my-script", - "warn": "", - } - `); + Object { + "debug": "", + "err": "", + "info": "", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Successfully deleted my-script", + "warn": "", + } + `); }); it("should delete a script by configuration", async () => { @@ -55,28 +58,34 @@ describe("delete", () => { await runWrangler("delete"); expect(std).toMatchInlineSnapshot(` - Object { - "debug": "", - "err": "", - "info": "", - "out": "Successfully deleted test-name", - "warn": "", - } - `); + Object { + "debug": "", + "err": "", + "info": "", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Successfully deleted test-name", + "warn": "", + } + `); }); it("shouldn't delete a service when doing a --dry-run", async () => { await runWrangler("delete --name xyz --dry-run"); expect(std).toMatchInlineSnapshot(` - Object { - "debug": "", - "err": "", - "info": "", - "out": "--dry-run: exiting now.", - "warn": "", - } - `); + Object { + "debug": "", + "err": "", + "info": "", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + --dry-run: exiting now.", + "warn": "", + } + `); }); it('shouldn\'t delete when the user says "no"', async () => { @@ -88,14 +97,16 @@ describe("delete", () => { await runWrangler("delete --name xyz"); expect(std).toMatchInlineSnapshot(` - Object { - "debug": "", - "err": "", - "info": "", - "out": "", - "warn": "", - } - `); + Object { + "debug": "", + "err": "", + "info": "", + "out": " + ⛅️ wrangler x.x.x + ──────────────────", + "warn": "", + } + `); }); it("should delete a site namespace associated with a worker", async () => { @@ -136,15 +147,18 @@ describe("delete", () => { mockDeleteWorkerRequest({ name: "my-script" }); await runWrangler("delete --name my-script"); expect(std).toMatchInlineSnapshot(` - Object { - "debug": "", - "err": "", - "info": "", - "out": "🌀 Deleted asset namespace for Workers Site \\"__my-script-workers_sites_assets\\" - Successfully deleted my-script", - "warn": "", - } - `); + Object { + "debug": "", + "err": "", + "info": "", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Deleted asset namespace for Workers Site \\"__my-script-workers_sites_assets\\" + Successfully deleted my-script", + "warn": "", + } + `); }); it("should delete a site namespace associated with a worker, including it's preview namespace", async () => { @@ -217,16 +231,19 @@ describe("delete", () => { mockDeleteWorkerRequest({ name: "my-script" }); await runWrangler("delete --name my-script"); expect(std).toMatchInlineSnapshot(` - Object { - "debug": "", - "err": "", - "info": "", - "out": "🌀 Deleted asset namespace for Workers Site \\"__my-script-workers_sites_assets\\" - 🌀 Deleted asset namespace for Workers Site \\"__my-script-workers_sites_assets_preview\\" - Successfully deleted my-script", - "warn": "", - } - `); + Object { + "debug": "", + "err": "", + "info": "", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Deleted asset namespace for Workers Site \\"__my-script-workers_sites_assets\\" + 🌀 Deleted asset namespace for Workers Site \\"__my-script-workers_sites_assets_preview\\" + Successfully deleted my-script", + "warn": "", + } + `); }); it("should error helpfully if pages_build_output_dir is set", async () => { @@ -316,14 +333,17 @@ Are you sure you want to continue?`, await runWrangler("delete"); expect(std).toMatchInlineSnapshot(` - Object { - "debug": "", - "err": "", - "info": "", - "out": "Successfully deleted test-name", - "warn": "", - } - `); + Object { + "debug": "", + "err": "", + "info": "", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Successfully deleted test-name", + "warn": "", + } + `); }); it("should not delete when extra confirmation to use force is denied", async () => { @@ -358,14 +378,16 @@ Are you sure you want to continue?`, await runWrangler("delete"); expect(std).toMatchInlineSnapshot(` - Object { - "debug": "", - "err": "", - "info": "", - "out": "", - "warn": "", - } - `); + Object { + "debug": "", + "err": "", + "info": "", + "out": " + ⛅️ wrangler x.x.x + ──────────────────", + "warn": "", + } + `); }); it("should not require confirmation when --force is used", async () => { @@ -375,14 +397,17 @@ Are you sure you want to continue?`, await runWrangler("delete --force"); expect(std).toMatchInlineSnapshot(` - Object { - "debug": "", - "err": "", - "info": "", - "out": "Successfully deleted test-name", - "warn": "", - } - `); + Object { + "debug": "", + "err": "", + "info": "", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Successfully deleted test-name", + "warn": "", + } + `); }); it("should prompt for extra confirmation when worker is used by a Pages function", async () => { @@ -413,14 +438,17 @@ Are you sure you want to continue?`, await runWrangler("delete"); expect(std).toMatchInlineSnapshot(` - Object { - "debug": "", - "err": "", - "info": "", - "out": "Successfully deleted test-name", - "warn": "", - } - `); + Object { + "debug": "", + "err": "", + "info": "", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Successfully deleted test-name", + "warn": "", + } + `); }); it("should include Pages function in confirmation when combined with other dependencies", async () => { @@ -468,14 +496,17 @@ Are you sure you want to continue?`, await runWrangler("delete"); expect(std).toMatchInlineSnapshot(` - Object { - "debug": "", - "err": "", - "info": "", - "out": "Successfully deleted test-name", - "warn": "", - } - `); + Object { + "debug": "", + "err": "", + "info": "", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Successfully deleted test-name", + "warn": "", + } + `); }); }); }); diff --git a/packages/wrangler/src/__tests__/deploy.test.ts b/packages/wrangler/src/__tests__/deploy.test.ts index 0f2f4cbfe2..b6acce165e 100644 --- a/packages/wrangler/src/__tests__/deploy.test.ts +++ b/packages/wrangler/src/__tests__/deploy.test.ts @@ -128,7 +128,10 @@ describe("deploy", () => { await runWrangler("deploy ./index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -185,7 +188,10 @@ describe("deploy", () => { await runWrangler("deploy ./index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -214,7 +220,10 @@ describe("deploy", () => { await runWrangler("deploy ./index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -239,7 +248,10 @@ describe("deploy", () => { await runWrangler("deploy ./index.js --env staging"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -300,7 +312,10 @@ describe("deploy", () => { mockSubDomainRequest(); await runWrangler("deploy ./some-path/worker/index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -341,7 +356,10 @@ describe("deploy", () => { await runWrangler("deploy ./my-worker/index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -416,7 +434,10 @@ describe("deploy", () => { await runWrangler("deploy ./my-worker/index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -474,6 +495,9 @@ describe("deploy", () => { ", "info": "", "out": " + ⛅️ wrangler x.x.x + ────────────────── + 📎 It looks like you are authenticating Wrangler via a custom API token set in an environment variable. Please ensure it has the correct permissions for this operation. @@ -538,7 +562,10 @@ describe("deploy", () => { "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Worker ID: abc12345 Worker ETag: etag98765 @@ -575,7 +602,10 @@ describe("deploy", () => { await expect(runWrangler("deploy index.js")).resolves.toBeUndefined(); expect(std.out).toMatchInlineSnapshot(` - "Attempting to login via OAuth... + " + ⛅️ wrangler x.x.x + ────────────────── + Attempting to login via OAuth... Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20secrets_store%3Awrite%20containers%3Awrite%20cloudchamber%3Awrite%20connectivity%3Aadmin%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256 Successfully logged in. Total Upload: xx KiB / gzip: xx KiB @@ -616,7 +646,10 @@ describe("deploy", () => { expect(accessTokenRequest.actual).toEqual(accessTokenRequest.expected); expect(std.out).toMatchInlineSnapshot(` - "Attempting to login via OAuth... + " + ⛅️ wrangler x.x.x + ────────────────── + Attempting to login via OAuth... Opening a link in your default browser: https://dash.staging.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20secrets_store%3Awrite%20containers%3Awrite%20cloudchamber%3Awrite%20connectivity%3Aadmin%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256 Successfully logged in. Total Upload: xx KiB / gzip: xx KiB @@ -643,7 +676,10 @@ describe("deploy", () => { await expect(runWrangler("deploy index.js")).resolves.toBeUndefined(); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -677,7 +713,10 @@ describe("deploy", () => { await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -701,7 +740,10 @@ describe("deploy", () => { await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -880,7 +922,10 @@ describe("deploy", () => { await runWrangler("deploy index.js --env some-env"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name-some-env (TIMINGS) Deployed test-name-some-env triggers (TIMINGS) @@ -902,7 +947,10 @@ describe("deploy", () => { await runWrangler("deploy index.js --legacy-env true"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -924,7 +972,10 @@ describe("deploy", () => { await runWrangler("deploy index.js --env some-env --legacy-env true"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name-some-env (TIMINGS) Deployed test-name-some-env triggers (TIMINGS) @@ -946,7 +997,10 @@ describe("deploy", () => { await runWrangler("deploy index.js --env some-env --legacy-env true"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name-some-env (TIMINGS) Deployed test-name-some-env triggers (TIMINGS) @@ -1017,7 +1071,10 @@ describe("deploy", () => { await runWrangler("deploy index.js --legacy-env false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -1047,7 +1104,10 @@ describe("deploy", () => { await runWrangler("deploy index.js --env some-env --legacy-env false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (some-env) (TIMINGS) Deployed test-name (some-env) triggers (TIMINGS) @@ -1092,7 +1152,10 @@ describe("deploy", () => { mockSubDomainRequest(); await runWrangler("deploy ./some-path/worker/index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -1138,7 +1201,10 @@ describe("deploy", () => { "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -1224,7 +1290,10 @@ describe("deploy", () => { "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -1268,7 +1337,10 @@ describe("deploy", () => { "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -1308,7 +1380,10 @@ describe("deploy", () => { "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -1412,7 +1487,10 @@ describe("deploy", () => { "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (staging) (TIMINGS) Deployed test-name (staging) triggers (TIMINGS) @@ -1559,7 +1637,10 @@ describe("deploy", () => { " `); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2175,7 +2256,10 @@ Update them to point to this script instead?`, " `); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2246,7 +2330,10 @@ Update them to point to this script instead?`, " `); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2317,7 +2404,10 @@ Update them to point to this script instead?`, " `); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2413,7 +2503,10 @@ Update them to point to this script instead?`, expect(std.warn).toMatchInlineSnapshot(`""`); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2478,7 +2571,10 @@ Update them to point to this script instead?`, await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2500,7 +2596,10 @@ Update them to point to this script instead?`, await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2519,7 +2618,10 @@ Update them to point to this script instead?`, await runWrangler("deploy"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2540,7 +2642,10 @@ Update them to point to this script instead?`, await runWrangler("deploy"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2558,7 +2663,10 @@ Update them to point to this script instead?`, await runWrangler("deploy index.ts"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2580,7 +2688,10 @@ Update them to point to this script instead?`, await runWrangler("deploy index.ts"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2613,7 +2724,10 @@ export default{ mockSubDomainRequest(); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2640,7 +2754,10 @@ export default{ mockSubDomainRequest(); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2659,7 +2776,10 @@ export default{ await runWrangler("deploy ./src/index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2702,7 +2822,10 @@ export default {};` "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB No bindings found. --dry-run: exiting now.", "warn": "", @@ -2737,7 +2860,10 @@ addEventListener('fetch', event => {});` "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB No bindings found. --dry-run: exiting now.", "warn": "▲ [WARNING] The entrypoint index.js has exports like an ES Module, but hasn't defined a default export like a module worker normally would. Building the worker using \\"service-worker\\" format... @@ -2760,7 +2886,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./src/index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -2785,7 +2914,12 @@ addEventListener('fetch', event => {});` - "site.bucket" is a required field.] `); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); expect(std.err).toMatchInlineSnapshot(` "X [ERROR] Processing wrangler.toml configuration: @@ -2842,7 +2976,10 @@ addEventListener('fetch', event => {});` + file-2.5938485188.txt (uploading new version of file-2.txt) Uploading 2 new assets... Uploaded 100% [2 out of 2]", - "out": "↗️ Done syncing assets + "out": " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -2900,7 +3037,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [2 out of 2]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -2976,7 +3116,12 @@ addEventListener('fetch', event => {});` ` ); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); expect(std.err).toMatchInlineSnapshot(` "X [ERROR] Missing entry-point to Worker script or to assets directory @@ -3190,6 +3335,9 @@ addEventListener('fetch', event => {});` `); expect(std.out).toMatchInlineSnapshot(` " + ⛅️ wrangler x.x.x + ────────────────── + No compatibility date found Defaulting to today: 2024-01-01 @@ -3253,6 +3401,9 @@ addEventListener('fetch', event => {});` `); expect(std.out).toMatchInlineSnapshot(` " + ⛅️ wrangler x.x.x + ────────────────── + No compatibility date found Defaulting to today: 2024-01-01 @@ -3364,6 +3515,9 @@ addEventListener('fetch', event => {});` expect(fs.existsSync("wrangler.jsonc")).toBe(false); expect(std.out).toMatchInlineSnapshot(` " + ⛅️ wrangler x.x.x + ────────────────── + No compatibility date found Defaulting to today: 2024-01-01 @@ -3416,7 +3570,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [2 out of 2]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -3473,7 +3630,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [2 out of 2]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -3537,7 +3697,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [2 out of 2]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -3638,7 +3801,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [2 out of 2]" `); expect(std.out).toMatchInlineSnapshot(` - "┌─┬─┬─┐ + " + ⛅️ wrangler x.x.x + ────────────────── + ┌─┬─┬─┐ │ Name │ Type │ Size │ ├─┼─┼─┤ │ a/1.mjs │ esm │ xx KiB │ @@ -3707,7 +3873,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [2 out of 2]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (some-env) (TIMINGS) @@ -3763,7 +3932,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [2 out of 2]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name-some-env (TIMINGS) @@ -3804,7 +3976,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy"); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -3851,7 +4026,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [1 out of 1]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -3898,7 +4076,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [1 out of 1]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -3946,7 +4127,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [1 out of 1]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -3994,7 +4178,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [1 out of 1]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -4042,7 +4229,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [1 out of 1]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -4090,7 +4280,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [1 out of 1]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -4140,7 +4333,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [1 out of 1]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -4194,7 +4390,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [1 out of 1]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -4246,7 +4445,12 @@ addEventListener('fetch', event => {});` Building list of assets to upload... + large-file.0ea0637a45.txt (uploading new version of large-file.txt)" `); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); expect(std.err).toMatchInlineSnapshot(` "X [ERROR] File too-large-file.txt is too big, it should be under 25 MiB. See https://developers.cloudflare.com/workers/platform/limits#kv-limits @@ -4304,7 +4508,10 @@ addEventListener('fetch', event => {});` expect(std.debug).toMatchInlineSnapshot(`""`); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -4380,7 +4587,12 @@ addEventListener('fetch', event => {});` "Fetching list of already uploaded assets... Building list of assets to upload..." `); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); expect(std.err).toMatchInlineSnapshot(` "X [ERROR] The asset path key \\"folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/folder/file.3da0d0cd12.txt\\" exceeds the maximum key size limit of 512. See https://developers.cloudflare.com/workers/platform/limits#kv-limits\\", @@ -4443,7 +4655,10 @@ addEventListener('fetch', event => {});` Removing 2 stale assets..." `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -4503,7 +4718,10 @@ addEventListener('fetch', event => {});` Uploaded 100% [2 out of 2]" `); expect(std.out).toMatchInlineSnapshot(` - "↗️ Done syncing assets + " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -4548,7 +4766,10 @@ addEventListener('fetch', event => {});` + file-2.5938485188.txt (uploading new version of file-2.txt) Uploading 2 new assets... Uploaded 100% [2 out of 2]", - "out": "↗️ Done syncing assets + "out": " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -4763,7 +4984,10 @@ addEventListener('fetch', event => {});` (truncating changed assets log, set \`WRANGLER_LOG=debug\` environment variable to see full diff) Uploading 110 new assets... Uploaded 100% [110 out of 110]", - "out": "↗️ Done syncing assets + "out": " + ⛅️ wrangler x.x.x + ────────────────── + ↗️ Done syncing assets Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -6048,7 +6272,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -6069,7 +6296,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -6090,7 +6320,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -6113,7 +6346,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -6135,7 +6371,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -6158,7 +6397,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -6182,7 +6424,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -6204,7 +6449,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) No deploy targets for test-name (TIMINGS) @@ -6226,7 +6474,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) No deploy targets for test-name (TIMINGS) @@ -6247,7 +6498,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) No deploy targets for test-name (TIMINGS) @@ -6269,7 +6523,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) No deploy targets for test-name (TIMINGS) @@ -6297,7 +6554,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index --env dev --legacy-env false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (dev) (TIMINGS) No deploy targets for test-name (dev) (TIMINGS) @@ -6325,7 +6585,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index --env dev --legacy-env false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (dev) (TIMINGS) No deploy targets for test-name (dev) (TIMINGS) @@ -6354,7 +6617,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index --env dev --legacy-env false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (dev) (TIMINGS) Deployed test-name (dev) triggers (TIMINGS) @@ -6385,7 +6651,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index --env dev --legacy-env false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (dev) (TIMINGS) Deployed test-name (dev) triggers (TIMINGS) @@ -6416,7 +6685,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index --env dev --legacy-env false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (dev) (TIMINGS) Deployed test-name (dev) triggers (TIMINGS) @@ -6450,7 +6722,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index --env dev --legacy-env false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (dev) (TIMINGS) Deployed test-name (dev) triggers (TIMINGS) @@ -6485,7 +6760,10 @@ addEventListener('fetch', event => {});` ); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (dev) (TIMINGS) Deployed test-name (dev) triggers (TIMINGS) @@ -6542,7 +6820,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -6563,7 +6844,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -6642,7 +6926,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -6679,7 +6966,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js --env production"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name-production (TIMINGS) Deployed test-name-production triggers (TIMINGS) @@ -6716,7 +7006,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js --env production"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name-production (TIMINGS) Deployed test-name-production triggers (TIMINGS) @@ -6747,7 +7040,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -6789,7 +7085,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js --env production"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name-production (TIMINGS) Deployed test-name-production triggers (TIMINGS) @@ -6831,7 +7130,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js --env production"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name-production (TIMINGS) Deployed test-name-production triggers (TIMINGS) @@ -6870,7 +7172,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js --env production"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name-production (TIMINGS) Deployed test-name-production triggers (TIMINGS) @@ -6908,7 +7213,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js --env production"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name-production (TIMINGS) Deployed test-name-production triggers (TIMINGS) @@ -6929,7 +7237,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -6956,7 +7267,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -6995,7 +7309,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) No deploy targets for test-name (TIMINGS) @@ -7018,7 +7335,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) No deploy targets for test-name (TIMINGS) @@ -7041,7 +7361,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -7065,7 +7388,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) No deploy targets for test-name (TIMINGS) @@ -7099,7 +7425,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy ./index"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -7261,7 +7590,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "[custom build] Running: node -e \\"4+4; require('fs').writeFileSync('index.js', 'export default { fetch(){ return new Response(123) } }')\\" + " + ⛅️ wrangler x.x.x + ────────────────── + [custom build] Running: node -e \\"4+4; require('fs').writeFileSync('index.js', 'export default { fetch(){ return new Response(123) } }')\\" Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -7288,7 +7620,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "[custom build] Running: echo \\"export default { fetch(){ return new Response(123) } }\\" > index.js + " + ⛅️ wrangler x.x.x + ────────────────── + [custom build] Running: echo \\"export default { fetch(){ return new Response(123) } }\\" > index.js Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) @@ -7315,7 +7650,10 @@ addEventListener('fetch', event => {});` The \`main\` property in your wrangler.toml file should point to the file generated by the custom build.] `); expect(std.out).toMatchInlineSnapshot(` - "[custom build] Running: node -e \\"4+4;\\" + " + ⛅️ wrangler x.x.x + ────────────────── + [custom build] Running: node -e \\"4+4;\\" " `); expect(std.err).toMatchInlineSnapshot(` @@ -7354,7 +7692,10 @@ addEventListener('fetch', event => {});` \`\`\`] `); expect(std.out).toMatchInlineSnapshot(` - "[custom build] Running: node -e \\"4+4;\\" + " + ⛅️ wrangler x.x.x + ────────────────── + [custom build] Running: node -e \\"4+4;\\" " `); expect(std.err).toMatchInlineSnapshot(` @@ -7397,7 +7738,10 @@ addEventListener('fetch', event => {});` mockSubDomainRequest(); await runWrangler("deploy index.js --minify"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -7438,7 +7782,10 @@ addEventListener('fetch', event => {});` mockSubDomainRequest(); await runWrangler("deploy -e testEnv index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (testEnv) (TIMINGS) Deployed test-name (testEnv) triggers (TIMINGS) @@ -7542,7 +7889,10 @@ addEventListener('fetch', event => {});` mockUploadWorkerRequest(); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -7596,7 +7946,10 @@ addEventListener('fetch', event => {});` mockUploadWorkerRequest(); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -7643,7 +7996,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -7699,7 +8055,10 @@ addEventListener('fetch', event => {});` "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -7747,7 +8106,10 @@ addEventListener('fetch', event => {});` "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -7797,7 +8159,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js --legacy-env false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -7864,7 +8229,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js --legacy-env false --env xyz"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -7930,7 +8298,10 @@ addEventListener('fetch', event => {});` "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -8004,7 +8375,10 @@ addEventListener('fetch', event => {});` "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -8064,7 +8438,10 @@ addEventListener('fetch', event => {});` "deploy index.js --dispatch-namespace test-namespace" ); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -8117,7 +8494,10 @@ addEventListener('fetch', event => {});` "deploy index.js --dispatch-namespace test-namespace" ); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -8151,7 +8531,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker is sending Tail events to the following Workers: - listener @@ -8178,7 +8561,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -8404,7 +8790,10 @@ addEventListener('fetch', event => {});` await expect(runWrangler("deploy index.js")).resolves.toBeUndefined(); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -8536,7 +8925,12 @@ addEventListener('fetch', event => {});` - Bindings must have unique names, so that they can all be referenced in the worker. Please change your bindings to have unique names.] `); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); expect(std.err).toMatchInlineSnapshot(` "X [ERROR] Processing wrangler.toml configuration: @@ -8645,7 +9039,12 @@ addEventListener('fetch', event => {});` - Bindings must have unique names, so that they can all be referenced in the worker. Please change your bindings to have unique names.] `); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); expect(std.err).toMatchInlineSnapshot(` "X [ERROR] Processing wrangler.toml configuration: @@ -8797,7 +9196,12 @@ addEventListener('fetch', event => {});` - Bindings must have unique names, so that they can all be referenced in the worker. Please change your bindings to have unique names.] `); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); expect(std.err).toMatchInlineSnapshot(` "X [ERROR] Processing wrangler.toml configuration: @@ -8846,7 +9250,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -8876,7 +9283,12 @@ addEventListener('fetch', event => {});` ).rejects.toThrowErrorMatchingInlineSnapshot( `[Error: You cannot configure [wasm_modules] with an ES module worker. Instead, import the .wasm module directly in your code]` ); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); expect(std.err).toMatchInlineSnapshot(` "X [ERROR] You cannot configure [wasm_modules] with an ES module worker. Instead, import the .wasm module directly in your code @@ -8917,7 +9329,10 @@ addEventListener('fetch', event => {});` mockSubDomainRequest(); await runWrangler("deploy index.js --config ./path/to/wrangler.toml"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -8957,7 +9372,10 @@ addEventListener('fetch', event => {});` mockSubDomainRequest(); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -8994,7 +9412,10 @@ addEventListener('fetch', event => {});` mockSubDomainRequest(); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9024,7 +9445,12 @@ addEventListener('fetch', event => {});` ).rejects.toThrowErrorMatchingInlineSnapshot( `[Error: You cannot configure [text_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your wrangler.toml file]` ); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); expect(std.err).toMatchInlineSnapshot(` "X [ERROR] You cannot configure [text_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your wrangler.toml file @@ -9069,7 +9495,10 @@ addEventListener('fetch', event => {});` mockSubDomainRequest(); await runWrangler("deploy index.js --config ./path/to/wrangler.toml"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9110,7 +9539,10 @@ addEventListener('fetch', event => {});` mockSubDomainRequest(); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9140,7 +9572,12 @@ addEventListener('fetch', event => {});` ).rejects.toThrowErrorMatchingInlineSnapshot( `[Error: You cannot configure [data_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your wrangler.toml file]` ); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); expect(std.err).toMatchInlineSnapshot(` "X [ERROR] You cannot configure [data_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your wrangler.toml file @@ -9185,7 +9622,10 @@ addEventListener('fetch', event => {});` mockSubDomainRequest(); await runWrangler("deploy index.js --config ./path/to/wrangler.toml"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9226,7 +9666,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9254,7 +9697,10 @@ addEventListener('fetch', event => {});` "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9286,7 +9732,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9337,7 +9786,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9412,7 +9864,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9461,7 +9916,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9505,7 +9963,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9553,7 +10014,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9609,7 +10073,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js --outdir tmp --dry-run"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Your Worker has access to the following bindings: Binding Resource env.EXAMPLE_DO_BINDING (ExampleDurableObject) Durable Object @@ -9667,7 +10134,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js --outdir tmp --dry-run"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Your Worker has access to the following bindings: Binding Resource env.EXAMPLE_DO_BINDING (ExampleDurableObject) Durable Object @@ -9735,7 +10205,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9777,7 +10250,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9817,7 +10293,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9850,7 +10329,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9889,7 +10371,10 @@ addEventListener('fetch', event => {});` }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -9948,7 +10433,10 @@ addEventListener('fetch', event => {});` }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -10000,7 +10488,10 @@ addEventListener('fetch', event => {});` }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -10045,7 +10536,10 @@ addEventListener('fetch', event => {});` }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -10087,7 +10581,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -10135,7 +10632,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -10179,7 +10679,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10283,7 +10786,10 @@ addEventListener('fetch', event => {});` await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10328,7 +10834,10 @@ addEventListener('fetch', event => {});` }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10359,7 +10868,10 @@ addEventListener('fetch', event => {});` }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10396,7 +10908,10 @@ addEventListener('fetch', event => {});` }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10497,7 +11012,10 @@ addEventListener('fetch', event => {});` }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10528,7 +11046,10 @@ addEventListener('fetch', event => {});` }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10560,7 +11081,10 @@ addEventListener('fetch', event => {});` }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10703,7 +11227,10 @@ addEventListener('fetch', event => {});` }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10734,7 +11261,10 @@ addEventListener('fetch', event => {});` }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10767,7 +11297,10 @@ addEventListener('fetch', event => {});` }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10798,7 +11331,10 @@ addEventListener('fetch', event => {});` "deploy index.js --compatibility-date 2022-03-17 --name test-name" ); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10842,7 +11378,10 @@ addEventListener('fetch', event => {});` "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10894,7 +11433,10 @@ addEventListener('fetch', event => {});` "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10920,7 +11462,10 @@ addEventListener('fetch', event => {});` "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -10977,7 +11522,10 @@ export default{ "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -11002,7 +11550,10 @@ export default{ "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -11092,7 +11643,10 @@ export default{ "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -11184,7 +11738,10 @@ export default{ "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -11226,7 +11783,10 @@ export default{ "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Your Worker has access to the following bindings: Binding Resource env.NAME (SomeClass) Durable Object @@ -11403,7 +11963,10 @@ export default{ "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB No bindings found. --dry-run: exiting now.", "warn": "", @@ -11436,7 +11999,10 @@ export default{ "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB No bindings found. --dry-run: exiting now.", "warn": "", @@ -11490,7 +12056,10 @@ export default{ "debug": "", "err": "", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -11563,7 +12132,10 @@ export default{ ", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB ", "warn": "", } @@ -11650,7 +12222,10 @@ export default{ ", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB ", "warn": "", } @@ -11725,7 +12300,10 @@ export default{ ", "info": "", - "out": "Total Upload: xx KiB / gzip: xx KiB + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB ", "warn": "", } @@ -11893,7 +12471,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -11936,7 +12517,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -11992,7 +12576,10 @@ export default{ }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -12045,7 +12632,10 @@ export default{ }); await runWrangler(`deploy index.js --name ${expectedScriptName}`); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded command-line-arg-script-name (TIMINGS) Deployed command-line-arg-script-name triggers (TIMINGS) @@ -12105,7 +12695,10 @@ export default{ }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -12170,7 +12763,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -12222,7 +12818,10 @@ export default{ }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -12282,7 +12881,10 @@ export default{ ); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -12342,7 +12944,10 @@ export default{ }); await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -12403,7 +13008,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -12464,7 +13072,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -12678,7 +13289,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -12711,7 +13325,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -12744,7 +13361,10 @@ export default{ await runWrangler("deploy"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -12797,7 +13417,10 @@ export default{ // Check that the table output shows vendor modules aggregated correctly expect(std.out).toMatchInlineSnapshot(` - "┌─┬─┬─┐ + " + ⛅️ wrangler x.x.x + ────────────────── + ┌─┬─┬─┐ │ Name │ Type │ Size │ ├─┼─┼─┤ │ helper.py │ python │ xx KiB │ @@ -12832,7 +13455,10 @@ export default{ await runWrangler("deploy index.py"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -12866,7 +13492,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -12904,7 +13533,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -12949,7 +13581,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -12983,7 +13618,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -13021,7 +13659,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -13061,7 +13702,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -13090,7 +13734,10 @@ export default{ await runWrangler("deploy index.js --keep-vars"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -13114,7 +13761,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -13140,7 +13790,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -13199,7 +13852,10 @@ export default{ "deploy --dispatch-namespace test-dispatch-namespace index.js" ); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Dispatch Namespace: test-dispatch-namespace @@ -13227,7 +13883,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -13268,7 +13927,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -13307,7 +13969,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -13330,7 +13995,10 @@ export default{ await runWrangler("deploy index.js"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Uploaded test-name (TIMINGS) Deployed test-name triggers (TIMINGS) @@ -13393,7 +14061,10 @@ export default{ expect(std.warn).toMatchInlineSnapshot(`""`); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -13455,7 +14126,10 @@ export default{ await runWrangler("deploy"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource diff --git a/packages/wrangler/src/__tests__/dev.test.ts b/packages/wrangler/src/__tests__/dev.test.ts index 1468230821..d600cdb5c7 100644 --- a/packages/wrangler/src/__tests__/dev.test.ts +++ b/packages/wrangler/src/__tests__/dev.test.ts @@ -335,7 +335,12 @@ describe.sequential("wrangler dev", () => { ` ); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); expect(std.err).toMatchInlineSnapshot(` "X [ERROR] Missing entry-point to Worker script or to assets directory @@ -891,7 +896,10 @@ describe.sequential("wrangler dev", () => { }); expect(std.out).toMatchInlineSnapshot( ` - "[custom build] Running: node -e \\"4+4; require('fs').writeFileSync('index.js', 'export default { fetch(){ return new Response(123) } }')\\" + " + ⛅️ wrangler x.x.x + ────────────────── + [custom build] Running: node -e \\"4+4; require('fs').writeFileSync('index.js', 'export default { fetch(){ return new Response(123) } }')\\" " ` ); @@ -915,7 +923,10 @@ describe.sequential("wrangler dev", () => { expect(std.out).toMatchInlineSnapshot( ` - "[custom build] Running: echo \\"export default { fetch(){ return new Response(123) } }\\" > index.js + " + ⛅️ wrangler x.x.x + ────────────────── + [custom build] Running: echo \\"export default { fetch(){ return new Response(123) } }\\" > index.js " ` ); @@ -936,7 +947,10 @@ describe.sequential("wrangler dev", () => { The \`main\` property in your wrangler.toml file should point to the file generated by the custom build.] `); expect(std.out).toMatchInlineSnapshot(` - "[custom build] Running: node -e \\"4+4;\\" + " + ⛅️ wrangler x.x.x + ────────────────── + [custom build] Running: node -e \\"4+4;\\" " `); expect(std.err).toMatchInlineSnapshot(` @@ -1475,7 +1489,10 @@ describe.sequential("wrangler dev", () => { process.platform === "win32" ? "127.0.0.1" : "localhost" ); expect(std.out).toMatchInlineSnapshot(` - "Your Worker has access to the following bindings: + " + ⛅️ wrangler x.x.x + ────────────────── + Your Worker has access to the following bindings: Binding Resource Mode env.NAME_1 (CLASS_1) Durable Object local env.NAME_2 (CLASS_2, defined in SCRIPT_A) Durable Object local [not connected] @@ -1557,7 +1574,10 @@ describe.sequential("wrangler dev", () => { UNQUOTED: "unquoted value", // Note that whitespace is trimmed }); expect(std.out).toMatchInlineSnapshot(` - "Using vars defined in .dev.vars + " + ⛅️ wrangler x.x.x + ────────────────── + Using vars defined in .dev.vars Your Worker has access to the following bindings: Binding Resource Mode env.VAR_1 (\\"(hidden)\\") Environment Variable local @@ -1592,7 +1612,10 @@ describe.sequential("wrangler dev", () => { expect(varBindings).toEqual({ CUSTOM_VAR: "custom" }); expect(std.out).toMatchInlineSnapshot(` - "Using vars defined in .dev.vars.custom + " + ⛅️ wrangler x.x.x + ────────────────── + Using vars defined in .dev.vars.custom Your Worker has access to the following bindings: Binding Resource Mode env.CUSTOM_VAR (\\"(hidden)\\") Environment Variable local @@ -1989,7 +2012,10 @@ describe.sequential("wrangler dev", () => { fs.writeFileSync("index.js", `export default {};`); await runWranglerUntilConfig("dev index.js"); expect(std.out).toMatchInlineSnapshot(` - "Your Worker has access to the following bindings: + " + ⛅️ wrangler x.x.x + ────────────────── + Your Worker has access to the following bindings: Binding Resource Mode env.WorkerA (A) Worker local [not connected] env.WorkerB (B) Worker local [not connected] @@ -2011,7 +2037,10 @@ describe.sequential("wrangler dev", () => { fs.writeFileSync("index.js", `export default {};`); await runWranglerUntilConfig("dev index.js"); expect(std.out).toMatchInlineSnapshot(` - "Your Worker has access to the following bindings: + " + ⛅️ wrangler x.x.x + ────────────────── + Your Worker has access to the following bindings: Binding Resource Mode env.WorkerA (A) Worker local [not connected] env.WorkerB (B) Worker local [not connected] @@ -2038,7 +2067,10 @@ describe.sequential("wrangler dev", () => { fs.writeFileSync("index.js", `export default {};`); await runWranglerUntilConfig("dev index.js"); expect(std.out).toMatchInlineSnapshot(` - "Using vars defined in .dev.vars + " + ⛅️ wrangler x.x.x + ────────────────── + Using vars defined in .dev.vars Your Worker has access to the following bindings: Binding Resource Mode env.variable (123) Environment Variable local diff --git a/packages/wrangler/src/__tests__/docs.test.ts b/packages/wrangler/src/__tests__/docs.test.ts index d1c2726286..602e88f3f1 100644 --- a/packages/wrangler/src/__tests__/docs.test.ts +++ b/packages/wrangler/src/__tests__/docs.test.ts @@ -68,7 +68,10 @@ describe("wrangler docs", () => { "debug": "", "err": "", "info": "", - "out": "Opening a link in your default browser: https://developers.cloudflare.com/workers/wrangler/commands/", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Opening a link in your default browser: https://developers.cloudflare.com/workers/wrangler/commands/", "warn": "", } `); @@ -86,7 +89,10 @@ describe("wrangler docs", () => { "debug": "", "err": "", "info": "", - "out": "Opening a link in your default browser: FAKE_DOCS_URL:{\\"params\\":\\"query=dev&hitsPerPage=1&getRankingInfo=0\\"}", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Opening a link in your default browser: FAKE_DOCS_URL:{\\"params\\":\\"query=dev&hitsPerPage=1&getRankingInfo=0\\"}", "warn": "", } `); @@ -104,7 +110,10 @@ describe("wrangler docs", () => { "debug": "", "err": "", "info": "", - "out": "Opening a link in your default browser: FAKE_DOCS_URL:{\\"params\\":\\"query=foo+bar&hitsPerPage=1&getRankingInfo=0\\"}", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Opening a link in your default browser: FAKE_DOCS_URL:{\\"params\\":\\"query=foo+bar&hitsPerPage=1&getRankingInfo=0\\"}", "warn": "", } `); diff --git a/packages/wrangler/src/__tests__/hello-world.local.test.ts b/packages/wrangler/src/__tests__/hello-world.local.test.ts index 725feda6f7..69e0d5392f 100644 --- a/packages/wrangler/src/__tests__/hello-world.local.test.ts +++ b/packages/wrangler/src/__tests__/hello-world.local.test.ts @@ -13,24 +13,42 @@ describe("hello-world", () => { it("should support get and set local storage", async () => { await runWrangler("hello-world get"); expect(std.out).toMatchInlineSnapshot(` - "👋 Getting value... + " + ⛅️ wrangler x.x.x + ────────────────── + 👋 Getting value... Value not found" `); await runWrangler(`hello-world set "hello world"`); expect(std.out).toMatchInlineSnapshot(` - "👋 Getting value... + " + ⛅️ wrangler x.x.x + ────────────────── + 👋 Getting value... Value not found + + ⛅️ wrangler x.x.x + ────────────────── 👋 Updating value... Updated" `); await runWrangler("hello-world get"); expect(std.out).toMatchInlineSnapshot(` - "👋 Getting value... + " + ⛅️ wrangler x.x.x + ────────────────── + 👋 Getting value... Value not found + + ⛅️ wrangler x.x.x + ────────────────── 👋 Updating value... Updated + + ⛅️ wrangler x.x.x + ────────────────── 👋 Getting value... hello world" `); diff --git a/packages/wrangler/src/__tests__/hyperdrive.test.ts b/packages/wrangler/src/__tests__/hyperdrive.test.ts index 4ba81d61dd..3457061c5f 100644 --- a/packages/wrangler/src/__tests__/hyperdrive.test.ts +++ b/packages/wrangler/src/__tests__/hyperdrive.test.ts @@ -121,7 +121,10 @@ describe("hyperdrive commands", () => { `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive PostgreSQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -157,7 +160,10 @@ describe("hyperdrive commands", () => { `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive PostgreSQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: [[hyperdrive]] @@ -187,7 +193,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive PostgreSQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -221,7 +230,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive MySQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -259,7 +271,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive PostgreSQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -294,7 +309,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive PostgreSQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -328,7 +346,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive PostgreSQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -362,7 +383,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive PostgreSQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -396,7 +420,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive PostgreSQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -430,7 +457,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive PostgreSQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -464,7 +494,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive PostgreSQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -498,7 +531,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive MySQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -573,7 +609,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive PostgreSQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -607,7 +646,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive PostgreSQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -673,7 +715,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive PostgreSQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -710,7 +755,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating 'test123' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating 'test123' ✅ Created new Hyperdrive PostgreSQL config: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx To access your new Hyperdrive Config in your Worker, add the following snippet to your configuration file: { @@ -782,7 +830,10 @@ describe("hyperdrive commands", () => { mockHyperdriveGetListOrDelete(); await runWrangler("hyperdrive list"); expect(std.out).toMatchInlineSnapshot(` - "📋 Listing Hyperdrive configs + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Listing Hyperdrive configs ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐ │ id │ name │ user │ host │ port │ scheme │ database │ caching │ mtls │ origin_connection_limit │ ├─┼─┼─┼─┼─┼─┼─┼─┼─┼─┤ @@ -799,7 +850,10 @@ describe("hyperdrive commands", () => { mockHyperdriveGetListOrDelete(); await runWrangler("hyperdrive get xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"); expect(std.out).toMatchInlineSnapshot(` - "{ + " + ⛅️ wrangler x.x.x + ────────────────── + { \\"id\\": \\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\\", \\"name\\": \\"test123\\", \\"origin\\": { @@ -818,9 +872,12 @@ describe("hyperdrive commands", () => { mockHyperdriveGetListOrDelete(); await runWrangler("hyperdrive delete xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"); expect(std.out).toMatchInlineSnapshot(` - "🗑️ Deleting Hyperdrive database config xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - ✅ Deleted" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + 🗑️ Deleting Hyperdrive database config xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + ✅ Deleted" + `); }); it("should handle updating a hyperdrive config's origin", async () => { @@ -837,7 +894,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' ✅ Updated xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Hyperdrive config { \\"id\\": \\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\\", @@ -868,7 +928,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' ✅ Updated xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Hyperdrive config { \\"id\\": \\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\\", @@ -896,7 +959,12 @@ describe("hyperdrive commands", () => { " `); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); }); it("should throw an exception when updating a hyperdrive config's origin but not all fields are set", async () => { @@ -927,7 +995,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' ✅ Updated xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Hyperdrive config { \\"id\\": \\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\\", @@ -962,7 +1033,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' ✅ Updated xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Hyperdrive config { \\"id\\": \\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\\", @@ -994,7 +1068,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' ✅ Updated xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Hyperdrive config { \\"id\\": \\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\\", @@ -1023,7 +1100,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' ✅ Updated xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Hyperdrive config { \\"id\\": \\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\\", @@ -1059,7 +1139,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' ✅ Updated xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Hyperdrive config { \\"id\\": \\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\\", @@ -1087,7 +1170,12 @@ describe("hyperdrive commands", () => { " `); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); }); it("should throw an exception when updating a hyperdrive config's origin with access credentials but no other origin fields", async () => { @@ -1102,7 +1190,12 @@ describe("hyperdrive commands", () => { " `); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); }); it("should reject an update command if the access client ID is provided but not the access client secret", async () => { @@ -1148,7 +1241,10 @@ describe("hyperdrive commands", () => { } `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Updating 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' ✅ Updated xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Hyperdrive config { \\"id\\": \\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\\", diff --git a/packages/wrangler/src/__tests__/index.test.ts b/packages/wrangler/src/__tests__/index.test.ts index 32d5c56bb8..3e69bc81fd 100644 --- a/packages/wrangler/src/__tests__/index.test.ts +++ b/packages/wrangler/src/__tests__/index.test.ts @@ -317,7 +317,10 @@ describe("wrangler", () => { await runWrangler("build"); await endEventLoop(); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB No bindings found. --dry-run: exiting now." `); diff --git a/packages/wrangler/src/__tests__/init.test.ts b/packages/wrangler/src/__tests__/init.test.ts index 0379bff27a..213a49de14 100644 --- a/packages/wrangler/src/__tests__/init.test.ts +++ b/packages/wrangler/src/__tests__/init.test.ts @@ -65,7 +65,10 @@ describe("init", () => { "debug": "", "err": "", "info": "", - "out": "🌀 Running \`mockpm create cloudflare@^2.5.0\`...", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Running \`mockpm create cloudflare@^2.5.0\`...", "warn": "", } `); @@ -112,7 +115,10 @@ describe("init", () => { "debug": "", "err": "", "info": "", - "out": "🌀 Running \`mockpm run create-cloudflare\`...", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Running \`mockpm run create-cloudflare\`...", "warn": "", } `); @@ -770,14 +776,17 @@ describe("init", () => { }); expect(std).toMatchInlineSnapshot(` - Object { - "debug": "", - "err": "", - "info": "", - "out": "🌀 Running \`mockpm create cloudflare@^2.5.0 existing-memory-crystal --existing-script existing-memory-crystal\`...", - "warn": "", - } - `); + Object { + "debug": "", + "err": "", + "info": "", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Running \`mockpm create cloudflare@^2.5.0 existing-memory-crystal --existing-script existing-memory-crystal\`...", + "warn": "", + } + `); expect(execa).toHaveBeenCalledTimes(1); expect(execa).toHaveBeenCalledWith( diff --git a/packages/wrangler/src/__tests__/kv.local.test.ts b/packages/wrangler/src/__tests__/kv.local.test.ts index 4521ac0f5e..6d00cf7fbd 100644 --- a/packages/wrangler/src/__tests__/kv.local.test.ts +++ b/packages/wrangler/src/__tests__/kv.local.test.ts @@ -22,6 +22,9 @@ describe("wrangler", () => { ); expect(std.out).toMatchInlineSnapshot(` "Value not found + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -33,6 +36,9 @@ describe("wrangler", () => { ); expect(std.out).toMatchInlineSnapshot(` "Value not found + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -70,6 +76,9 @@ describe("wrangler", () => { await runWrangler(`kv key list --namespace-id some-namespace-id`); expect(std.out).toMatchInlineSnapshot(` "[] + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -102,6 +111,9 @@ describe("wrangler", () => { expect(std.out).toMatchInlineSnapshot(` "[] + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -148,7 +160,10 @@ describe("wrangler", () => { `kv key get val --namespace-id some-namespace-id --text` ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Writing the value \\"value\\" to key \\"val\\" on namespace some-namespace-id. @@ -156,11 +171,17 @@ describe("wrangler", () => { `); await runWrangler(`kv key delete val --namespace-id some-namespace-id`); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Writing the value \\"value\\" to key \\"val\\" on namespace some-namespace-id. value + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -171,11 +192,17 @@ describe("wrangler", () => { `kv key get val --namespace-id some-namespace-id --text` ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Writing the value \\"value\\" to key \\"val\\" on namespace some-namespace-id. value + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -209,6 +236,9 @@ describe("wrangler", () => { ); expect(std.out).toMatchInlineSnapshot(` "[] + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -220,6 +250,9 @@ describe("wrangler", () => { ); expect(std.out).toMatchInlineSnapshot(` "[] + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -232,6 +265,9 @@ describe("wrangler", () => { ); expect(std.out).toMatchInlineSnapshot(` "[] + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -243,6 +279,9 @@ describe("wrangler", () => { await runWrangler(`kv key list --namespace-id bulk-namespace-id`); expect(std.out).toMatchInlineSnapshot(` "[] + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -280,7 +319,10 @@ describe("wrangler", () => { ); await runWrangler(`kv key list --namespace-id bulk-namespace-id`); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Success! @@ -299,7 +341,10 @@ describe("wrangler", () => { `kv bulk delete keys.json --namespace-id bulk-namespace-id --force` ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Success! @@ -311,6 +356,9 @@ describe("wrangler", () => { \\"name\\": \\"test\\" } ] + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -319,7 +367,10 @@ describe("wrangler", () => { await runWrangler(`kv key list --namespace-id bulk-namespace-id`); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Success! @@ -331,6 +382,9 @@ describe("wrangler", () => { \\"name\\": \\"test\\" } ] + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -356,7 +410,10 @@ describe("wrangler", () => { ); await runWrangler(`kv key list --namespace-id bulk-namespace-id`); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Success! @@ -382,7 +439,10 @@ describe("wrangler", () => { `kv bulk delete keys.json --namespace-id bulk-namespace-id --force` ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Success! @@ -394,6 +454,9 @@ describe("wrangler", () => { \\"name\\": \\"test\\" } ] + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -402,7 +465,10 @@ describe("wrangler", () => { await runWrangler(`kv key list --namespace-id bulk-namespace-id`); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Success! @@ -414,6 +480,9 @@ describe("wrangler", () => { \\"name\\": \\"test\\" } ] + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -439,7 +508,10 @@ describe("wrangler", () => { ); await runWrangler(`kv key list --namespace-id bulk-namespace-id`); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Success! @@ -458,7 +530,10 @@ describe("wrangler", () => { `kv bulk get keys.json --namespace-id bulk-namespace-id` ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Success! @@ -492,10 +567,16 @@ describe("wrangler", () => { `kv key put val persistValue --namespace-id some-namespace-id --persist-to ./persistdir` ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Writing the value \\"value\\" to key \\"val\\" on namespace some-namespace-id. + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -506,10 +587,16 @@ describe("wrangler", () => { `kv key get val --namespace-id some-namespace-id --text` ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Writing the value \\"value\\" to key \\"val\\" on namespace some-namespace-id. + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -521,10 +608,16 @@ describe("wrangler", () => { `kv key get val --namespace-id some-namespace-id --text --persist-to ./persistdir` ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Writing the value \\"value\\" to key \\"val\\" on namespace some-namespace-id. + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. diff --git a/packages/wrangler/src/__tests__/kv.test.ts b/packages/wrangler/src/__tests__/kv.test.ts index ac0a233fe6..27cd03aeed 100644 --- a/packages/wrangler/src/__tests__/kv.test.ts +++ b/packages/wrangler/src/__tests__/kv.test.ts @@ -426,7 +426,10 @@ describe("wrangler", () => { ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Deleting KV namespace env-bound-id. Deleted KV namespace env-bound-id." `); @@ -553,7 +556,10 @@ describe("wrangler", () => { ); expect(requests.count).toEqual(1); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Renaming KV namespace some-namespace-id to \\"new-namespace-name\\". ✨ Successfully renamed namespace to \\"new-namespace-name\\"" `); @@ -576,7 +582,10 @@ describe("wrangler", () => { expect(listRequests.count).toEqual(1); expect(updateRequests.count).toEqual(1); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Renaming KV namespace some-namespace-id to \\"new-namespace-name\\". ✨ Successfully renamed namespace to \\"new-namespace-name\\"" `); @@ -691,7 +700,10 @@ describe("wrangler", () => { expect(requests.count).toEqual(1); expect(std.out).toMatchInlineSnapshot( ` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Writing the value \\"my-value\\" to key \\"my-key\\" on namespace some-namespace-id." ` ); @@ -711,7 +723,10 @@ describe("wrangler", () => { expect(requests.count).toEqual(1); expect(std.out).toMatchInlineSnapshot( ` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Writing the value \\"my-value\\" to key \\"/my-key\\" on namespace DS9." ` ); @@ -730,7 +745,10 @@ describe("wrangler", () => { expect(std.out).toMatchInlineSnapshot( ` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Writing the value \\"my-value\\" to key \\"my-key\\" on namespace bound-id." ` ); @@ -751,7 +769,10 @@ describe("wrangler", () => { expect(std.out).toMatchInlineSnapshot( ` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Writing the value \\"my-value\\" to key \\"my-key\\" on namespace preview-bound-id." ` ); @@ -772,7 +793,10 @@ describe("wrangler", () => { expect(requests.count).toEqual(1); expect(std.out).toMatchInlineSnapshot( ` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Writing the value \\"my-value\\" to key \\"my-key\\" on namespace some-namespace-id." ` ); @@ -790,7 +814,10 @@ describe("wrangler", () => { ); expect(std.out).toMatchInlineSnapshot( ` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Writing the value \\"my-value\\" to key \\"my-key\\" on namespace env-bound-id." ` ); @@ -810,7 +837,10 @@ describe("wrangler", () => { ); expect(std.out).toMatchInlineSnapshot( ` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Writing the contents of foo.txt to the key \\"my-key\\" on namespace some-namespace-id." ` ); @@ -833,7 +863,10 @@ describe("wrangler", () => { ); expect(std.out).toMatchInlineSnapshot( ` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Writing the contents of test.png to the key \\"my-key\\" on namespace another-namespace-id." ` ); @@ -855,7 +888,10 @@ describe("wrangler", () => { expect(requests.count).toEqual(1); expect(std.out).toMatchInlineSnapshot( ` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Writing the value \\"dVal\\" to key \\"dKey\\" on namespace some-namespace-id with metadata \\"{\\"mKey\\":\\"mValue\\"}\\"." ` ); @@ -881,7 +917,10 @@ describe("wrangler", () => { expect(requests.count).toEqual(1); expect(std.out).toMatchInlineSnapshot( ` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Writing the contents of test.png to the key \\"another-my-key\\" on namespace some-namespace-id with metadata \\"{\\"mKey\\":\\"mValue\\"}\\"." ` ); @@ -941,6 +980,9 @@ describe("wrangler", () => { expect(std.out).toMatchInlineSnapshot(` " + ⛅️ wrangler x.x.x + ────────────────── + wrangler kv key put [value] Write a single key/value pair to the given namespace @@ -987,6 +1029,9 @@ describe("wrangler", () => { expect(std.out).toMatchInlineSnapshot(` " + ⛅️ wrangler x.x.x + ────────────────── + wrangler kv key put [value] Write a single key/value pair to the given namespace @@ -1031,6 +1076,9 @@ describe("wrangler", () => { expect(std.out).toMatchInlineSnapshot(` " + ⛅️ wrangler x.x.x + ────────────────── + wrangler kv key put [value] Write a single key/value pair to the given namespace @@ -1121,6 +1169,9 @@ describe("wrangler", () => { expect(std.out).toMatchInlineSnapshot(` " + ⛅️ wrangler x.x.x + ────────────────── + wrangler kv key put [value] Write a single key/value pair to the given namespace @@ -1165,7 +1216,10 @@ describe("wrangler", () => { ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote " `); expect(std.err).toMatchInlineSnapshot(` @@ -1189,7 +1243,10 @@ describe("wrangler", () => { `[Error: someBinding has both a namespace ID and a preview ID. Specify "--preview" or "--preview false" to avoid writing data to the wrong namespace.]` ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote " `); expect(std.err).toMatchInlineSnapshot(` @@ -1762,7 +1819,10 @@ describe("wrangler", () => { expect(requests.count).toEqual(1); expect(std.out).toMatchInlineSnapshot( ` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Deleting the key \\"/NCC-74656\\" on namespace voyager." ` ); @@ -1810,7 +1870,10 @@ describe("wrangler", () => { ); expect(std.out).toMatchInlineSnapshot( ` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Deleting the key \\"someKey\\" on namespace env-bound-id." ` ); @@ -1872,7 +1935,10 @@ describe("wrangler", () => { ); expect(requests.count).toEqual(1); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Success!" `); expect(std.warn).toMatchInlineSnapshot(`""`); @@ -1891,7 +1957,10 @@ describe("wrangler", () => { ); expect(requests.count).toEqual(12); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Uploaded 0% (0 out of 12,000) Uploaded 8% (1,000 out of 12,000) Uploaded 16% (2,000 out of 12,000) @@ -1923,7 +1992,10 @@ describe("wrangler", () => { Expected an array of key-value objects but got type "object".] `); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote " `); expect(std.warn).toMatchInlineSnapshot(`""`); @@ -1987,7 +2059,10 @@ describe("wrangler", () => { `); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote " `); expect(std.warn).toMatchInlineSnapshot(` @@ -2119,7 +2194,10 @@ describe("wrangler", () => { ); expect(requests.count).toEqual(1); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Success!" `); expect(std.warn).toMatchInlineSnapshot(`""`); @@ -2142,7 +2220,10 @@ describe("wrangler", () => { ); expect(requests.count).toEqual(1); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Success!" `); expect(std.warn).toMatchInlineSnapshot(`""`); @@ -2162,7 +2243,10 @@ describe("wrangler", () => { ); expect(requests.count).toEqual(12); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Deleted 0% (0 out of 12,000) Deleted 8% (1,000 out of 12,000) Deleted 16% (2,000 out of 12,000) @@ -2194,7 +2278,10 @@ describe("wrangler", () => { ); expect(std.out).toMatchInlineSnapshot( ` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Not deleting keys read from \\"keys.json\\"." ` ); @@ -2211,7 +2298,10 @@ describe("wrangler", () => { ); expect(requests.count).toEqual(1); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Success!" `); expect(std.warn).toMatchInlineSnapshot(`""`); @@ -2227,7 +2317,10 @@ describe("wrangler", () => { ); expect(requests.count).toEqual(1); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Success!" `); expect(std.warn).toMatchInlineSnapshot(`""`); @@ -2251,7 +2344,10 @@ describe("wrangler", () => { 12354] `); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote " `); expect(std.warn).toMatchInlineSnapshot(`""`); @@ -2276,7 +2372,10 @@ describe("wrangler", () => { The item at index 3 is type: "object" - null] `); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote " `); expect(std.warn).toMatchInlineSnapshot(`""`); diff --git a/packages/wrangler/src/__tests__/logout.test.ts b/packages/wrangler/src/__tests__/logout.test.ts index c14c584fcd..d6bc2a48c3 100644 --- a/packages/wrangler/src/__tests__/logout.test.ts +++ b/packages/wrangler/src/__tests__/logout.test.ts @@ -13,13 +13,23 @@ describe("logout", () => { it("should exit with a message stating the user is not logged in", async () => { await runWrangler("logout", { CLOUDFLARE_API_TOKEN: undefined }); - expect(std.out).toMatchInlineSnapshot(`"Not logged in, exiting..."`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + Not logged in, exiting..." + `); }); it("should exit with a message stating the user logged in via API token", async () => { await runWrangler("logout", { CLOUDFLARE_API_TOKEN: "DUMMY_TOKEN" }); expect(std.out).toMatchInlineSnapshot( - `"You are logged in with an API Token. Unset the CLOUDFLARE_API_TOKEN in the environment to log out."` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + You are logged in with an API Token. Unset the CLOUDFLARE_API_TOKEN in the environment to log out." + ` ); }); @@ -47,7 +57,12 @@ describe("logout", () => { await runWrangler("logout", { CLOUDFLARE_API_TOKEN: undefined }); - expect(std.out).toMatchInlineSnapshot(`"Successfully logged out."`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + Successfully logged out." + `); expect(fs.existsSync(config)).toBeFalsy(); expect(counter).toBe(1); }); @@ -76,7 +91,12 @@ describe("logout", () => { await runWrangler("logout"); - expect(std.out).toMatchInlineSnapshot(`"Successfully logged out."`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + Successfully logged out." + `); expect(std.warn).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(`""`); expect(fs.existsSync(config)).toBeFalsy(); diff --git a/packages/wrangler/src/__tests__/metrics.test.ts b/packages/wrangler/src/__tests__/metrics.test.ts index 81432cc36e..9103f13b6c 100644 --- a/packages/wrangler/src/__tests__/metrics.test.ts +++ b/packages/wrangler/src/__tests__/metrics.test.ts @@ -270,6 +270,9 @@ describe("metrics", () => { expect(std.out).toMatchInlineSnapshot(` " Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md + + ⛅️ wrangler x.x.x + ────────────────── Opening a link in your default browser: FAKE_DOCS_URL:{\\"params\\":\\"query=arg&hitsPerPage=1&getRankingInfo=0\\"}" `); expect(std.warn).toMatchInlineSnapshot(`""`); @@ -407,6 +410,9 @@ describe("metrics", () => { expect(std.out).toMatchInlineSnapshot(` " Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md + + ⛅️ wrangler x.x.x + ────────────────── Opening a link in your default browser: FAKE_DOCS_URL:{\\"params\\":\\"query=arg&hitsPerPage=1&getRankingInfo=0\\"}" `); expect(std.warn).toMatchInlineSnapshot(`""`); @@ -492,6 +498,9 @@ describe("metrics", () => { expect(std.out).toMatchInlineSnapshot(` " Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md + + ⛅️ wrangler x.x.x + ────────────────── Opening a link in your default browser: FAKE_DOCS_URL:{\\"params\\":\\"query=arg&hitsPerPage=1&getRankingInfo=0\\"}" `); @@ -524,6 +533,9 @@ describe("metrics", () => { expect(std.out).toMatchInlineSnapshot(` " Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md + + ⛅️ wrangler x.x.x + ────────────────── Opening a link in your default browser: FAKE_DOCS_URL:{\\"params\\":\\"query=arg&hitsPerPage=1&getRankingInfo=0\\"}" `); expect(requests.count).toBe(2); @@ -559,7 +571,10 @@ describe("metrics", () => { await runWrangler("telemetry status"); expect(std.out).toMatchInlineSnapshot(` - "Status: Enabled + " + ⛅️ wrangler x.x.x + ────────────────── + Status: Enabled To configure telemetry globally on this machine, you can run \`wrangler telemetry disable / enable\`. You can override this for individual projects with the environment variable \`WRANGLER_SEND_METRICS=true/false\`. diff --git a/packages/wrangler/src/__tests__/mtls-certificates.test.ts b/packages/wrangler/src/__tests__/mtls-certificates.test.ts index 88ad24ab4f..c37bcd84be 100644 --- a/packages/wrangler/src/__tests__/mtls-certificates.test.ts +++ b/packages/wrangler/src/__tests__/mtls-certificates.test.ts @@ -489,7 +489,11 @@ Expires on: ${oneYearLater.toLocaleDateString()} " `); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ──────────────────" + `); }); it("should require not providing --id and --name", async () => { @@ -500,7 +504,11 @@ Expires on: ${oneYearLater.toLocaleDateString()} " `); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ──────────────────" + `); }); it("should delete certificate by id", async () => { @@ -516,7 +524,12 @@ Expires on: ${oneYearLater.toLocaleDateString()} expect(std.err).toMatchInlineSnapshot(`""`); expect(std.out).toMatchInlineSnapshot( - `"Deleted certificate 1234 (my-cert) successfully"` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Deleted certificate 1234 (my-cert) successfully" + ` ); }); @@ -533,7 +546,12 @@ Expires on: ${oneYearLater.toLocaleDateString()} expect(std.err).toMatchInlineSnapshot(`""`); expect(std.out).toMatchInlineSnapshot( - `"Deleted certificate 1234 (my-cert) successfully"` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Deleted certificate 1234 (my-cert) successfully" + ` ); }); @@ -545,7 +563,12 @@ Expires on: ${oneYearLater.toLocaleDateString()} ).rejects.toMatchInlineSnapshot( `[Error: certificate not found with name "my-cert"]` ); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); }); it("should not delete when many certificates are found by name", async () => { @@ -573,7 +596,12 @@ Expires on: ${oneYearLater.toLocaleDateString()} ).rejects.toMatchInlineSnapshot( `[Error: multiple certificates found with name "my-cert"]` ); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); }); it("should not delete when confirmation fails", async () => { @@ -586,7 +614,12 @@ Expires on: ${oneYearLater.toLocaleDateString()} await runWrangler("mtls-certificate delete --id 1234"); expect(std.err).toMatchInlineSnapshot(`""`); - expect(std.out).toMatchInlineSnapshot(`"Not deleting"`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + Not deleting" + `); }); }); }); diff --git a/packages/wrangler/src/__tests__/pages/__snapshots__/deploy.test.ts.snap b/packages/wrangler/src/__tests__/pages/__snapshots__/deploy.test.ts.snap index d78ccfd3b5..f047b63bec 100644 --- a/packages/wrangler/src/__tests__/pages/__snapshots__/deploy.test.ts.snap +++ b/packages/wrangler/src/__tests__/pages/__snapshots__/deploy.test.ts.snap @@ -3,7 +3,10 @@ exports[`pages deploy > with wrangler.json configuration > should always deploy to the Pages project specified by the top-level \`name\` configuration field, regardless of the corresponding env-level configuration 1`] = `"2ea0b43fa4411e79883bfbfc1dcb4360d1789067eca64a492604d59b8eab932c"`; exports[`pages deploy > with wrangler.json configuration > should always deploy to the Pages project specified by the top-level \`name\` configuration field, regardless of the corresponding env-level configuration 2`] = ` -"✨ Success! Uploaded 1 files (TIMINGS) +" + ⛅️ wrangler x.x.x +────────────────── +✨ Success! Uploaded 1 files (TIMINGS) ✨ Compiled Worker successfully ✨ Uploading Worker bundle @@ -16,7 +19,10 @@ exports[`pages deploy > with wrangler.json configuration > should error if user exports[`pages deploy > with wrangler.json configuration > should support wrangler.json 1`] = `"b6a9158832033622c937859452cd6fe4d9542ec8a863c17aa84f761140b750b9"`; exports[`pages deploy > with wrangler.json configuration > should support wrangler.json 2`] = ` -"✨ Success! Uploaded 1 files (TIMINGS) +" + ⛅️ wrangler x.x.x +────────────────── +✨ Success! Uploaded 1 files (TIMINGS) ✨ Compiled Worker successfully ✨ Uploading Worker bundle @@ -29,7 +35,10 @@ exports[`pages deploy > with wrangler.json configuration > should warn and ignor exports[`pages deploy > with wrangler.toml configuration > should always deploy to the Pages project specified by the top-level \`name\` configuration field, regardless of the corresponding env-level configuration 1`] = `"b5f53af7922efd0f0b73c7bf288f7e3f14df5c31e8b654e98027ddf85ea7e574"`; exports[`pages deploy > with wrangler.toml configuration > should always deploy to the Pages project specified by the top-level \`name\` configuration field, regardless of the corresponding env-level configuration 2`] = ` -"✨ Success! Uploaded 1 files (TIMINGS) +" + ⛅️ wrangler x.x.x +────────────────── +✨ Success! Uploaded 1 files (TIMINGS) ✨ Compiled Worker successfully ✨ Uploading Worker bundle @@ -42,7 +51,10 @@ exports[`pages deploy > with wrangler.toml configuration > should error if user exports[`pages deploy > with wrangler.toml configuration > should support wrangler.toml 1`] = `"62e8895a4896fc18db089b5590f7ecce38de8c1f38b515b1861da4bfd6ae7596"`; exports[`pages deploy > with wrangler.toml configuration > should support wrangler.toml 2`] = ` -"✨ Success! Uploaded 1 files (TIMINGS) +" + ⛅️ wrangler x.x.x +────────────────── +✨ Success! Uploaded 1 files (TIMINGS) ✨ Compiled Worker successfully ✨ Uploading Worker bundle diff --git a/packages/wrangler/src/__tests__/pages/deploy.test.ts b/packages/wrangler/src/__tests__/pages/deploy.test.ts index ebe63a61d7..e89e3d0b7e 100644 --- a/packages/wrangler/src/__tests__/pages/deploy.test.ts +++ b/packages/wrangler/src/__tests__/pages/deploy.test.ts @@ -247,7 +247,10 @@ describe("pages deploy", () => { expect(getProjectRequestCount).toBe(2); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) 🌎 Deploying... ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/" @@ -418,7 +421,10 @@ describe("pages deploy", () => { expect(getProjectRequestCount).toBe(2); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) 🌎 Deploying... ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/" @@ -582,7 +588,10 @@ describe("pages deploy", () => { expect(requests.length).toBe(2); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) 🌎 Deploying... ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/" @@ -802,7 +811,10 @@ describe("pages deploy", () => { expect(getProjectRequestCount).toEqual(2); expect(getDeploymentDetailsRequestCount).toEqual(3); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Compiled Worker successfully + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully ✨ Success! Uploaded 1 files (TIMINGS) ✨ Uploading Functions bundle @@ -1010,7 +1022,10 @@ describe("pages deploy", () => { await runWrangler("pages deploy . --project-name=foo"); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) 🌎 Deploying... ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/" @@ -1204,7 +1219,10 @@ describe("pages deploy", () => { ); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 4 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 4 files (TIMINGS) 🌎 Deploying... ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/" @@ -1397,7 +1415,10 @@ describe("pages deploy", () => { ); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 4 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 4 files (TIMINGS) 🌎 Deploying... ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/" @@ -1592,7 +1613,10 @@ describe("pages deploy", () => { ); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 4 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 4 files (TIMINGS) 🌎 Deploying... ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/" @@ -1933,7 +1957,10 @@ describe("pages deploy", () => { expect(getProjectRequestCount).toBe(2); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Successfully created the 'foo' project. + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Successfully created the 'foo' project. ✨ Success! Uploaded 1 files (TIMINGS) 🌎 Deploying... @@ -2181,7 +2208,10 @@ describe("pages deploy", () => { expect(getProjectRequestCount).toEqual(2); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Compiled Worker successfully + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully ✨ Success! Uploaded 1 files (TIMINGS) ✨ Uploading Functions bundle @@ -2436,7 +2466,10 @@ async function onRequest() { expect(getProjectRequestCount).toEqual(2); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Compiled Worker successfully + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully ✨ Success! Uploaded 1 files (TIMINGS) ✨ Uploading Functions bundle @@ -2704,7 +2737,10 @@ async function onRequest() { expect(getProjectRequestCount).toEqual(2); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Compiled Worker successfully + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully ✨ Success! Uploaded 1 files (TIMINGS) ✨ Uploading Functions bundle @@ -3238,7 +3274,10 @@ and that at least one include rule is provided. expect(getProjectRequestCount).toEqual(2); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) ✨ Compiled Worker successfully ✨ Uploading Worker bundle @@ -3508,7 +3547,10 @@ and that at least one include rule is provided. expect(getProjectRequestCount).toEqual(2); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) ✨ Compiled Worker successfully ✨ Uploading Worker bundle @@ -3775,7 +3817,10 @@ and that at least one include rule is provided. expect(getProjectRequestCount).toEqual(2); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) ✨ Compiled Worker successfully ✨ Uploading Worker bundle @@ -4137,7 +4182,10 @@ and that at least one include rule is provided. expect(getProjectRequestCount).toEqual(2); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) ✨ Compiled Worker successfully ✨ Uploading Worker bundle @@ -4503,7 +4551,10 @@ and that at least one include rule is provided. await runWrangler("pages deploy public --project-name=foo --no-bundle"); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) ✨ Uploading Worker bundle 🌎 Deploying... @@ -5606,7 +5657,10 @@ and that at least one include rule is provided. await runWrangler("pages deploy public --project-name=foo"); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) 🌎 Deploying... ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/ @@ -5626,7 +5680,10 @@ and that at least one include rule is provided. await runWrangler("pages deploy public --project-name=foo"); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) 🌎 Deploying... ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/" @@ -5645,7 +5702,10 @@ and that at least one include rule is provided. await runWrangler("pages deploy public --project-name=foo"); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) 🌎 Deploying... ✨ Deployment complete! Take a peek over at https://abcxyz.foo.pages.dev/" diff --git a/packages/wrangler/src/__tests__/pages/deployment-list.test.ts b/packages/wrangler/src/__tests__/pages/deployment-list.test.ts index 5691147c39..f77cdd47cb 100644 --- a/packages/wrangler/src/__tests__/pages/deployment-list.test.ts +++ b/packages/wrangler/src/__tests__/pages/deployment-list.test.ts @@ -8,7 +8,6 @@ import { runWrangler } from "./../helpers/run-wrangler"; import type { Deployment } from "./../../pages/types"; describe("pages deployment list", () => { - vi.unmock("../../wrangler-banner"); runInTempDir(); mockAccountId(); mockApiToken(); diff --git a/packages/wrangler/src/__tests__/pages/functions-build.test.ts b/packages/wrangler/src/__tests__/pages/functions-build.test.ts index 8ebc793ce6..5adc8a6921 100644 --- a/packages/wrangler/src/__tests__/pages/functions-build.test.ts +++ b/packages/wrangler/src/__tests__/pages/functions-build.test.ts @@ -47,7 +47,12 @@ describe("pages functions build", () => { await runWrangler(`pages functions build`); expect(existsSync("_worker.bundle")).toBe(true); - expect(std.out).toMatchInlineSnapshot(`"✨ Compiled Worker successfully"`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully" + `); expect(std.err).toMatchInlineSnapshot(`""`); }); @@ -83,7 +88,12 @@ describe("pages functions build", () => { await runWrangler(`pages functions build --outfile=_worker.bundle`); expect(existsSync("_worker.bundle")).toBe(true); - expect(std.out).toMatchInlineSnapshot(`"✨ Compiled Worker successfully"`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully" + `); // some values in workerBundleContents, such as the undici form boundary // or the file hashes, are randomly generated. Let's replace them @@ -157,7 +167,12 @@ describe("pages functions build", () => { await runWrangler(`pages functions build --outdir=dist`); expect(existsSync("dist")).toBe(true); - expect(std.out).toMatchInlineSnapshot(`"✨ Compiled Worker successfully"`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully" + `); expect(readdirSync("dist").sort()).toMatchInlineSnapshot(` Array [ @@ -226,7 +241,12 @@ export default { `pages functions build --build-output-directory=public --outfile=_worker.bundle` ); expect(existsSync("_worker.bundle")).toBe(true); - expect(std.out).toMatchInlineSnapshot(`"✨ Compiled Worker successfully"`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully" + `); // some values in workerBundleContents, such as the undici form boundary // or the file hashes, are randomly generated. Let's replace them @@ -302,7 +322,12 @@ export default { // built to _worker.js by default expect(existsSync("_worker.bundle")).toBe(true); - expect(std.out).toMatchInlineSnapshot(`"✨ Compiled Worker successfully"`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully" + `); // some values in workerBundleContents, such as the undici form boundary // or the file hashes, are randomly generated. Let's replace them @@ -373,7 +398,12 @@ export default { await runWrangler(`pages functions build --outfile=public/_worker.bundle`); expect(existsSync("public/_worker.bundle")).toBe(true); - expect(std.out).toMatchInlineSnapshot(`"✨ Compiled Worker successfully"`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully" + `); // some values in workerBundleContents, such as the undici form boundary // or the file hashes, are randomly generated. Let's replace them @@ -432,7 +462,12 @@ export default { ); expect(existsSync("public/_worker.bundle")).toBe(true); - expect(std.out).toMatchInlineSnapshot(`"✨ Compiled Worker successfully"`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully" + `); expect(readFileSync("public/_worker.bundle", "utf-8")).toContain( `import { AsyncLocalStorage } from "node:async_hooks";` @@ -498,7 +533,10 @@ export const cat = "dog";` expect(existsSync("public/_worker.bundle")).toBe(true); expect(std.out).toMatchInlineSnapshot(` - "┌─┬─┬─┐ + " + ⛅️ wrangler x.x.x + ────────────────── + ┌─┬─┬─┐ │ Name │ Type │ Size │ ├─┼─┼─┤ │ cat.js │ esm │ xx KiB │ @@ -701,7 +739,12 @@ export default { `pages functions build --build-output-directory public --outfile=_worker.bundle --build-metadata-path build-metadata.json --project-directory .` ); expect(existsSync("_worker.bundle")).toBe(true); - expect(std.out).toMatchInlineSnapshot(`"✨ Compiled Worker successfully"`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully" + `); // some values in workerBundleContents, such as the undici form boundary // or the file hashes, are randomly generated. Let's replace them @@ -871,7 +914,12 @@ export default { `pages functions build --build-output-directory dist-test --outfile=_worker.bundle --build-metadata-path build-metadata.json --project-directory .` ); expect(existsSync("_worker.bundle")).toBe(true); - expect(std.out).toMatchInlineSnapshot(`"✨ Compiled Worker successfully"`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully" + `); // some values in workerBundleContents, such as the undici form boundary // or the file hashes, are randomly generated. Let's replace them @@ -1039,7 +1087,12 @@ export default { `pages functions build --build-output-directory dist-test --outfile=_worker.bundle --build-metadata-path build-metadata.json --project-directory .` ); expect(existsSync("_worker.bundle")).toBe(true); - expect(std.out).toMatchInlineSnapshot(`"✨ Compiled Worker successfully"`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully" + `); // some values in workerBundleContents, such as the undici form boundary // or the file hashes, are randomly generated. Let's replace them @@ -1128,7 +1181,12 @@ export default { `pages functions build --build-output-directory dist-test --outfile=_worker.bundle --build-metadata-path build-metadata.json --project-directory .` ); expect(existsSync("_worker.bundle")).toBe(true); - expect(std.out).toMatchInlineSnapshot(`"✨ Compiled Worker successfully"`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Compiled Worker successfully" + `); // some values in workerBundleContents, such as the undici form boundary // or the file hashes, are randomly generated. Let's replace them diff --git a/packages/wrangler/src/__tests__/pages/pages-build-env.test.ts b/packages/wrangler/src/__tests__/pages/pages-build-env.test.ts index 6de750e90d..023ab8fb83 100644 --- a/packages/wrangler/src/__tests__/pages/pages-build-env.test.ts +++ b/packages/wrangler/src/__tests__/pages/pages-build-env.test.ts @@ -29,7 +29,10 @@ describe("pages build env", () => { }); await runWrangler("pages functions build-env . --outfile data.json"); expect(std.out).toMatchInlineSnapshot(` - "Checking for configuration in a Wrangler configuration file (BETA) + " + ⛅️ wrangler x.x.x + ────────────────── + Checking for configuration in a Wrangler configuration file (BETA) Found wrangler.toml file. Reading build configuration... pages_build_output_dir: dist @@ -62,7 +65,10 @@ describe("pages build env", () => { expect(process.exitCode).toEqual(EXIT_CODE_NO_CONFIG_FOUND); expect(std.out).toMatchInlineSnapshot(` - "Checking for configuration in a Wrangler configuration file (BETA) + " + ⛅️ wrangler x.x.x + ────────────────── + Checking for configuration in a Wrangler configuration file (BETA) " `); expect(std.debug).toContain( @@ -104,7 +110,10 @@ describe("pages build env", () => { expect(process.exitCode).toEqual(EXIT_CODE_INVALID_PAGES_CONFIG); expect(std.out).toMatchInlineSnapshot(` - "Checking for configuration in a Wrangler configuration file (BETA) + " + ⛅️ wrangler x.x.x + ────────────────── + Checking for configuration in a Wrangler configuration file (BETA) Found wrangler.toml file. Reading build configuration..." `); @@ -130,7 +139,10 @@ describe("pages build env", () => { " `); expect(std.out).toMatchInlineSnapshot(` - "Checking for configuration in a Wrangler configuration file (BETA) + " + ⛅️ wrangler x.x.x + ────────────────── + Checking for configuration in a Wrangler configuration file (BETA) Found wrangler.toml file. Reading build configuration..." `); @@ -170,7 +182,10 @@ describe("pages build env", () => { expect(process.exitCode).toEqual(EXIT_CODE_INVALID_PAGES_CONFIG); expect(std.out).toMatchInlineSnapshot(` - "Checking for configuration in a Wrangler configuration file (BETA) + " + ⛅️ wrangler x.x.x + ────────────────── + Checking for configuration in a Wrangler configuration file (BETA) Found wrangler.toml file. Reading build configuration..." `); @@ -217,7 +232,10 @@ describe("pages build env", () => { await runWrangler("pages functions build-env . --outfile data.json"); expect(process.exitCode).toEqual(EXIT_CODE_INVALID_PAGES_CONFIG); expect(std.out).toMatchInlineSnapshot(` - "Checking for configuration in a Wrangler configuration file (BETA) + " + ⛅️ wrangler x.x.x + ────────────────── + Checking for configuration in a Wrangler configuration file (BETA) Found wrangler.toml file. Reading build configuration..." `); @@ -253,7 +271,10 @@ describe("pages build env", () => { }); await runWrangler("pages functions build-env . --outfile data.json"); expect(std.out).toMatchInlineSnapshot(` - "Checking for configuration in a Wrangler configuration file (BETA) + " + ⛅️ wrangler x.x.x + ────────────────── + Checking for configuration in a Wrangler configuration file (BETA) Found wrangler.toml file. Reading build configuration... pages_build_output_dir: dist @@ -299,7 +320,10 @@ describe("pages build env", () => { ); await runWrangler("pages functions build-env . --outfile data.json"); expect(std.out).toMatchInlineSnapshot(` - "Checking for configuration in a Wrangler configuration file (BETA) + " + ⛅️ wrangler x.x.x + ────────────────── + Checking for configuration in a Wrangler configuration file (BETA) Found wrangler.json file. Reading build configuration... pages_build_output_dir: dist @@ -342,7 +366,10 @@ describe("pages build env", () => { }); await runWrangler("pages functions build-env . --outfile data.json"); expect(std.out).toMatchInlineSnapshot(` - "Checking for configuration in a Wrangler configuration file (BETA) + " + ⛅️ wrangler x.x.x + ────────────────── + Checking for configuration in a Wrangler configuration file (BETA) Found wrangler.toml file. Reading build configuration... pages_build_output_dir: dist @@ -386,7 +413,10 @@ describe("pages build env", () => { }); await runWrangler("pages functions build-env . --outfile data.json"); expect(std.out).toMatchInlineSnapshot(` - "Checking for configuration in a Wrangler configuration file (BETA) + " + ⛅️ wrangler x.x.x + ────────────────── + Checking for configuration in a Wrangler configuration file (BETA) Found wrangler.toml file. Reading build configuration... pages_build_output_dir: dist @@ -417,7 +447,10 @@ describe("pages build env", () => { await runWrangler("pages functions build-env . --outfile data.json"); expect(std.out).toMatchInlineSnapshot(` - "Checking for configuration in a Wrangler configuration file (BETA) + " + ⛅️ wrangler x.x.x + ────────────────── + Checking for configuration in a Wrangler configuration file (BETA) Found wrangler.json file. Reading build configuration... pages_build_output_dir: build/dist diff --git a/packages/wrangler/src/__tests__/pages/pages-deployment-tail.test.ts b/packages/wrangler/src/__tests__/pages/pages-deployment-tail.test.ts index a5aefb8a66..06be1e2664 100644 --- a/packages/wrangler/src/__tests__/pages/pages-deployment-tail.test.ts +++ b/packages/wrangler/src/__tests__/pages/pages-deployment-tail.test.ts @@ -21,8 +21,6 @@ import type { import type { RequestInit } from "undici"; import type WebSocket from "ws"; -// we want to include the banner to make sure it doesn't show up in the output when --format=json -vi.unmock("../../wrangler-banner"); vi.mock("ws", async (importOriginal) => { // eslint-disable-next-line @typescript-eslint/consistent-type-imports const realModule = await importOriginal(); diff --git a/packages/wrangler/src/__tests__/pages/pages-download-config.test.ts b/packages/wrangler/src/__tests__/pages/pages-download-config.test.ts index 706bbe6e70..bd56b3561b 100644 --- a/packages/wrangler/src/__tests__/pages/pages-download-config.test.ts +++ b/packages/wrangler/src/__tests__/pages/pages-download-config.test.ts @@ -876,7 +876,10 @@ describe("pages download config", () => { ", "info": "", - "out": "", + "out": " + ⛅️ wrangler x.x.x + ────────────────── + ", "warn": "▲ [WARNING] 🚧 \`wrangler pages download config\` is an experimental command. Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose ", @@ -1046,7 +1049,10 @@ describe("pages download config", () => { " `); expect(std.out).toMatchInlineSnapshot(` - "? Your existing Wrangler configuration file will be overwritten. Continue? + " + ⛅️ wrangler x.x.x + ────────────────── + ? Your existing Wrangler configuration file will be overwritten. Continue? 🤖 Using fallback value in non-interactive context: no " `); @@ -1221,6 +1227,9 @@ describe("pages download config", () => { `); expect(std.out).toMatchInlineSnapshot(` " + ⛅️ wrangler x.x.x + ────────────────── + If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose" `); }); diff --git a/packages/wrangler/src/__tests__/pages/pages.test.ts b/packages/wrangler/src/__tests__/pages/pages.test.ts index 9737c46e59..f684947031 100644 --- a/packages/wrangler/src/__tests__/pages/pages.test.ts +++ b/packages/wrangler/src/__tests__/pages/pages.test.ts @@ -255,13 +255,23 @@ describe("pages", () => { `[Error: Must specify a directory of static assets to serve, or a command to run, or a proxy port, or configure \`pages_build_output_dir\` in your Wrangler configuration file.]` ); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); }); it("should display for pages:functions:build", async () => { await expect(runWrangler("pages functions build")).rejects.toThrowError(); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); }); it("should display for pages:functions:optimize-routes", async () => { @@ -271,7 +281,12 @@ describe("pages", () => { ) ).rejects.toThrowError(); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); }); }); }); diff --git a/packages/wrangler/src/__tests__/pages/project-create.test.ts b/packages/wrangler/src/__tests__/pages/project-create.test.ts index a0645c99e2..a59937e89e 100644 --- a/packages/wrangler/src/__tests__/pages/project-create.test.ts +++ b/packages/wrangler/src/__tests__/pages/project-create.test.ts @@ -60,9 +60,12 @@ describe("pages project create", () => { ); expect(std.out).toMatchInlineSnapshot(` - "✨ Successfully created the 'a-new-project' project. It will be available at https://a-new-project.pages.dev/ once you create your first deployment. - To deploy a folder of assets, run 'wrangler pages deploy [directory]'." - `); + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Successfully created the 'a-new-project' project. It will be available at https://a-new-project.pages.dev/ once you create your first deployment. + To deploy a folder of assets, run 'wrangler pages deploy [directory]'." + `); }); it("should create a project with compatibility flags", async () => { @@ -102,9 +105,12 @@ describe("pages project create", () => { ); expect(std.out).toMatchInlineSnapshot(` - "✨ Successfully created the 'a-new-project' project. It will be available at https://a-new-project.pages.dev/ once you create your first deployment. - To deploy a folder of assets, run 'wrangler pages deploy [directory]'." - `); + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Successfully created the 'a-new-project' project. It will be available at https://a-new-project.pages.dev/ once you create your first deployment. + To deploy a folder of assets, run 'wrangler pages deploy [directory]'." + `); }); it("should create a project with a compatibility date", async () => { @@ -144,9 +150,12 @@ describe("pages project create", () => { ); expect(std.out).toMatchInlineSnapshot(` - "✨ Successfully created the 'a-new-project' project. It will be available at https://a-new-project.pages.dev/ once you create your first deployment. - To deploy a folder of assets, run 'wrangler pages deploy [directory]'." - `); + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Successfully created the 'a-new-project' project. It will be available at https://a-new-project.pages.dev/ once you create your first deployment. + To deploy a folder of assets, run 'wrangler pages deploy [directory]'." + `); }); it("should override cached accountId with CLOUDFLARE_ACCOUNT_ID environmental variable if provided", async () => { diff --git a/packages/wrangler/src/__tests__/pages/project-delete.test.ts b/packages/wrangler/src/__tests__/pages/project-delete.test.ts index e5c37b4f2e..0c4f296f5a 100644 --- a/packages/wrangler/src/__tests__/pages/project-delete.test.ts +++ b/packages/wrangler/src/__tests__/pages/project-delete.test.ts @@ -58,9 +58,12 @@ describe("pages project delete", () => { await runWrangler("pages project delete some-project-name"); expect(std.out).toMatchInlineSnapshot(` - "Deleting some-project-name - Successfully deleted some-project-name" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Deleting some-project-name + Successfully deleted some-project-name" + `); }); it("should error if no project name is specified", async () => { @@ -79,7 +82,11 @@ describe("pages project delete", () => { await runWrangler("pages project delete some-project-name-2"); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ──────────────────" + `); }); it("should delete a project without asking if --yes provided", async () => { @@ -106,9 +113,12 @@ describe("pages project delete", () => { await runWrangler("pages project delete some-project-name -y"); expect(std.out).toMatchInlineSnapshot(` - "Deleting some-project-name - Successfully deleted some-project-name" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Deleting some-project-name + Successfully deleted some-project-name" + `); }); it("should override cached accountId with CLOUDFLARE_ACCOUNT_ID environmental variable if provided", async () => { diff --git a/packages/wrangler/src/__tests__/pages/project-upload.test.ts b/packages/wrangler/src/__tests__/pages/project-upload.test.ts index 924328f1d1..11b35ac249 100644 --- a/packages/wrangler/src/__tests__/pages/project-upload.test.ts +++ b/packages/wrangler/src/__tests__/pages/project-upload.test.ts @@ -95,10 +95,13 @@ describe("pages project upload", () => { await runWrangler("pages project upload ."); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) - ✨ Upload complete!" - `); + ✨ Upload complete!" + `); }); it("should avoid uploading some files", async () => { @@ -219,10 +222,13 @@ describe("pages project upload", () => { }); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 3 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 3 files (TIMINGS) - ✨ Upload complete!" - `); + ✨ Upload complete!" + `); }); it("should retry uploads", async () => { @@ -313,10 +319,13 @@ describe("pages project upload", () => { } expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) - ✨ Upload complete!" - `); + ✨ Upload complete!" + `); }); it("should retry uploads after gateway failures", async () => { @@ -394,10 +403,13 @@ describe("pages project upload", () => { } expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 1 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 1 files (TIMINGS) - ✨ Upload complete!" - `); + ✨ Upload complete!" + `); }); it("should try to use multiple buckets (up to the max concurrency)", async () => { @@ -507,10 +519,13 @@ describe("pages project upload", () => { ); expect(normalizeProgressSteps(std.out)).toMatchInlineSnapshot(` - "✨ Success! Uploaded 4 files (TIMINGS) + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Success! Uploaded 4 files (TIMINGS) - ✨ Upload complete!" - `); + ✨ Upload complete!" + `); }); it("should handle a very large number of assets", async () => { diff --git a/packages/wrangler/src/__tests__/pages/project-validate.test.ts b/packages/wrangler/src/__tests__/pages/project-validate.test.ts index f2c7f74232..7c0b0bd0ba 100644 --- a/packages/wrangler/src/__tests__/pages/project-validate.test.ts +++ b/packages/wrangler/src/__tests__/pages/project-validate.test.ts @@ -28,7 +28,11 @@ describe("pages project validate", () => { await runWrangler("pages project validate ."); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ──────────────────" + `); expect(std.err).toMatchInlineSnapshot(`""`); }); diff --git a/packages/wrangler/src/__tests__/pages/secret.test.ts b/packages/wrangler/src/__tests__/pages/secret.test.ts index 737df81fd1..f21b8dfb8f 100644 --- a/packages/wrangler/src/__tests__/pages/secret.test.ts +++ b/packages/wrangler/src/__tests__/pages/secret.test.ts @@ -97,9 +97,12 @@ describe("wrangler pages secret", () => { "pages secret put secret-name --project some-project-name" ); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Pages project \\"some-project-name\\" (production) - ✨ Success! Uploaded secret secret-name" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Pages project \\"some-project-name\\" (production) + ✨ Success! Uploaded secret secret-name" + `); }); it("should create a secret", async () => { @@ -115,9 +118,12 @@ describe("wrangler pages secret", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Pages project \\"some-project-name\\" (production) - ✨ Success! Uploaded secret the-key" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Pages project \\"some-project-name\\" (production) + ✨ Success! Uploaded secret the-key" + `); expect(std.err).toMatchInlineSnapshot(`""`); }); @@ -134,9 +140,12 @@ describe("wrangler pages secret", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Pages project \\"some-project-name\\" (preview) - ✨ Success! Uploaded secret the-key" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Pages project \\"some-project-name\\" (preview) + ✨ Success! Uploaded secret the-key" + `); expect(std.err).toMatchInlineSnapshot(`""`); }); @@ -184,9 +193,12 @@ describe("wrangler pages secret", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Pages project \\"some-project-name\\" (production) - ✨ Success! Uploaded secret the-key" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Pages project \\"some-project-name\\" (production) + ✨ Success! Uploaded secret the-key" + `); expect(std.warn).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(`""`); }); @@ -200,9 +212,12 @@ describe("wrangler pages secret", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Pages project \\"some-project-name\\" (production) - ✨ Success! Uploaded secret the-key" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Pages project \\"some-project-name\\" (production) + ✨ Success! Uploaded secret the-key" + `); expect(std.warn).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(`""`); }); @@ -217,9 +232,12 @@ describe("wrangler pages secret", () => { ); expect(std.out).toMatchInlineSnapshot(` - " - If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + + If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose" + `); expect(std.warn).toMatchInlineSnapshot(`""`); }); @@ -331,9 +349,12 @@ describe("wrangler pages secret", () => { "pages secret delete the-key --project some-project-name" ); expect(std.out).toMatchInlineSnapshot(` - "🌀 Deleting the secret the-key on the Pages project some-project-name (production) - ✨ Success! Deleted secret the-key" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Deleting the secret the-key on the Pages project some-project-name (production) + ✨ Success! Deleted secret the-key" + `); expect(std.err).toMatchInlineSnapshot(`""`); }); @@ -347,9 +368,12 @@ describe("wrangler pages secret", () => { "pages secret delete the-key --project some-project-name --env preview" ); expect(std.out).toMatchInlineSnapshot(` - "🌀 Deleting the secret the-key on the Pages project some-project-name (preview) - ✨ Success! Deleted secret the-key" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Deleting the secret the-key on the Pages project some-project-name (preview) + ✨ Success! Deleted secret the-key" + `); expect(std.err).toMatchInlineSnapshot(`""`); }); @@ -416,10 +440,13 @@ describe("wrangler pages secret", () => { mockListRequest(); await runWrangler("pages secret list --project some-project-name"); expect(std.out).toMatchInlineSnapshot(` - "The \\"production\\" environment of your Pages project \\"some-project-name\\" has access to the following secrets: - - the-secret-name: Value Encrypted - - the-secret-name-2: Value Encrypted" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + The \\"production\\" environment of your Pages project \\"some-project-name\\" has access to the following secrets: + - the-secret-name: Value Encrypted + - the-secret-name-2: Value Encrypted" + `); expect(std.err).toMatchInlineSnapshot(`""`); }); @@ -429,9 +456,12 @@ describe("wrangler pages secret", () => { "pages secret list --project some-project-name --env preview" ); expect(std.out).toMatchInlineSnapshot(` - "The \\"preview\\" environment of your Pages project \\"some-project-name\\" has access to the following secrets: - - the-secret-name-preview: Value Encrypted" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + The \\"preview\\" environment of your Pages project \\"some-project-name\\" has access to the following secrets: + - the-secret-name-preview: Value Encrypted" + `); expect(std.err).toMatchInlineSnapshot(`""`); }); @@ -531,7 +561,10 @@ describe("wrangler pages secret", () => { await runWrangler(`pages secret bulk --project some-project-name`); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secrets for the Pages project \\"some-project-name\\" (production) + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secrets for the Pages project \\"some-project-name\\" (production) Finished processing secrets file: ✨ 2 secrets successfully uploaded" `); @@ -562,7 +595,10 @@ describe("wrangler pages secret", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secrets for the Pages project \\"some-project-name\\" (production) + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secrets for the Pages project \\"some-project-name\\" (production) Finished processing secrets file: ✨ 2 secrets successfully uploaded" `); @@ -592,7 +628,10 @@ describe("wrangler pages secret", () => { await runWrangler("pages secret bulk .env --project some-project-name"); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secrets for the Pages project \\"some-project-name\\" (production) + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secrets for the Pages project \\"some-project-name\\" (production) Finished processing secrets file: ✨ 3 secrets successfully uploaded" `); @@ -627,7 +666,10 @@ describe("wrangler pages secret", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secrets for the Pages project \\"some-project-name\\" (preview) + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secrets for the Pages project \\"some-project-name\\" (preview) Finished processing secrets file: ✨ 2 secrets successfully uploaded" `); @@ -685,7 +727,10 @@ describe("wrangler pages secret", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secrets for the Pages project \\"some-project-name\\" (production) + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secrets for the Pages project \\"some-project-name\\" (production) 🚨 Secrets failed to upload If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose" @@ -749,7 +794,10 @@ describe("wrangler pages secret", () => { ", "info": "", - "out": "🌀 Creating the secrets for the Worker \\"script-name\\" + "out": " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secrets for the Worker \\"script-name\\" 🚨 Secrets failed to upload ", diff --git a/packages/wrangler/src/__tests__/pipelines.test.ts b/packages/wrangler/src/__tests__/pipelines.test.ts index c3fd1e2c4a..4c037b85ce 100644 --- a/packages/wrangler/src/__tests__/pipelines.test.ts +++ b/packages/wrangler/src/__tests__/pipelines.test.ts @@ -11,8 +11,6 @@ import { runWrangler } from "./helpers/run-wrangler"; import type { Pipeline, SchemaField, Sink, Stream } from "../pipelines/types"; describe("wrangler pipelines", () => { - vi.unmock("../wrangler-banner"); - const std = mockConsoleMethods(); mockAccountId(); mockApiToken(); diff --git a/packages/wrangler/src/__tests__/provision.test.ts b/packages/wrangler/src/__tests__/provision.test.ts index 1feb858295..fb2e78e193 100644 --- a/packages/wrangler/src/__tests__/provision.test.ts +++ b/packages/wrangler/src/__tests__/provision.test.ts @@ -89,7 +89,10 @@ describe("--x-provision", () => { await runWrangler("deploy --x-provision --x-auto-create=false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -173,7 +176,10 @@ describe("--x-provision", () => { await runWrangler("deploy --x-provision --x-auto-create=false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB The following bindings need to be provisioned: Binding Resource @@ -290,7 +296,10 @@ describe("--x-provision", () => { await runWrangler("deploy --x-provision --x-auto-create=false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB The following bindings need to be provisioned: Binding Resource @@ -417,7 +426,10 @@ describe("--x-provision", () => { await runWrangler("deploy --x-provision --x-auto-create=false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB The following bindings need to be provisioned: Binding Resource @@ -495,7 +507,10 @@ describe("--x-provision", () => { await runWrangler("deploy --x-provision --x-auto-create=false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB The following bindings need to be provisioned: Binding Resource @@ -551,7 +566,10 @@ describe("--x-provision", () => { await runWrangler("deploy --x-provision --x-auto-create=false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -617,7 +635,10 @@ describe("--x-provision", () => { await runWrangler("deploy --x-provision --x-auto-create=false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB The following bindings need to be provisioned: Binding Resource @@ -692,7 +713,10 @@ describe("--x-provision", () => { await runWrangler("deploy --x-provision --x-auto-create=false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB The following bindings need to be provisioned: Binding Resource @@ -760,7 +784,10 @@ describe("--x-provision", () => { await runWrangler("deploy --x-provision --x-auto-create=false"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -805,7 +832,10 @@ describe("--x-provision", () => { await runWrangler("deploy --x-provision"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 100 ms Your Worker has access to the following bindings: Binding Resource @@ -878,7 +908,10 @@ describe("--x-provision", () => { await runWrangler("deploy --x-provision"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB The following bindings need to be provisioned: Binding Resource diff --git a/packages/wrangler/src/__tests__/queues/queues-subscription.test.ts b/packages/wrangler/src/__tests__/queues/queues-subscription.test.ts index 42216014ed..2148c766b6 100644 --- a/packages/wrangler/src/__tests__/queues/queues-subscription.test.ts +++ b/packages/wrangler/src/__tests__/queues/queues-subscription.test.ts @@ -19,7 +19,6 @@ import type { } from "../../queues/subscription-types"; describe("queues subscription", () => { - vi.unmock("../../wrangler-banner"); mockAccountId(); mockApiToken(); runInTempDir(); diff --git a/packages/wrangler/src/__tests__/queues/queues.test.ts b/packages/wrangler/src/__tests__/queues/queues.test.ts index b182c6f0ed..50b7c89664 100644 --- a/packages/wrangler/src/__tests__/queues/queues.test.ts +++ b/packages/wrangler/src/__tests__/queues/queues.test.ts @@ -11,7 +11,6 @@ import { mockGetQueueByNameRequest } from "./mock-utils"; import type { PostTypedConsumerBody, QueueResponse } from "../../queues/client"; describe("wrangler", () => { - vi.unmock("../../wrangler-banner"); mockAccountId(); mockApiToken(); runInTempDir(); diff --git a/packages/wrangler/src/__tests__/r2.local.test.ts b/packages/wrangler/src/__tests__/r2.local.test.ts index d913cbe920..e0e4e468e6 100644 --- a/packages/wrangler/src/__tests__/r2.local.test.ts +++ b/packages/wrangler/src/__tests__/r2.local.test.ts @@ -28,11 +28,17 @@ describe("r2", () => { `r2 object put bucket-object-test/wormhole-img.png --file ./wormhole-img.png ` ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Downloading \\"wormhole-img.png\\" from \\"bucket-object-test\\". + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -44,16 +50,25 @@ describe("r2", () => { `r2 object get bucket-object-test/wormhole-img.png --file ./wormhole-img.png ` ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Downloading \\"wormhole-img.png\\" from \\"bucket-object-test\\". + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. Creating object \\"wormhole-img.png\\" in bucket \\"bucket-object-test\\". Upload complete. + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -73,11 +88,17 @@ describe("r2", () => { `r2 object get bucket-object-test/wormhole-img.png --file ./wormhole-img.png ` ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Creating object \\"wormhole-img.png\\" in bucket \\"bucket-object-test\\". Upload complete. + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -89,16 +110,25 @@ describe("r2", () => { `r2 object delete bucket-object-test/wormhole-img.png ` ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Creating object \\"wormhole-img.png\\" in bucket \\"bucket-object-test\\". Upload complete. + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. Downloading \\"wormhole-img.png\\" from \\"bucket-object-test\\". Download complete. + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. @@ -137,21 +167,33 @@ describe("r2", () => { `r2 object get bucket-object-test/file-two --file ./wormhole-img.png --persist-to ./different-dir` ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: local + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: local Use --remote if you want to access the remote instance. Creating object \\"file-one\\" in bucket \\"bucket-object-test\\". Upload complete. + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. Creating object \\"file-two\\" in bucket \\"bucket-object-test\\". Upload complete. + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. Downloading \\"file-one\\" from \\"bucket-object-test\\". + + ⛅️ wrangler x.x.x + ────────────────── Resource location: local Use --remote if you want to access the remote instance. diff --git a/packages/wrangler/src/__tests__/r2.test.ts b/packages/wrangler/src/__tests__/r2.test.ts index 362ac3de0b..c5c0560901 100644 --- a/packages/wrangler/src/__tests__/r2.test.ts +++ b/packages/wrangler/src/__tests__/r2.test.ts @@ -252,13 +252,16 @@ describe("r2", () => { await runWrangler(`r2 bucket list`); expect(std.out).toMatchInlineSnapshot(` - "Listing buckets... + " + ⛅️ wrangler x.x.x + ────────────────── + Listing buckets... name: bucket-1-local-once creation_date: 01-01-2001 name: bucket-2-local-once creation_date: 01-01-2001" - `); + `); }); }); @@ -293,14 +296,17 @@ describe("r2", () => { ); await runWrangler(`r2 bucket info ${bucketName}`); expect(std.out).toMatchInlineSnapshot(` - "Getting info for 'my-bucket'... - name: my-bucket - created: 01-01-2001 - location: WNAM - default_storage_class: Standard - object_count: 0 - bucket_size: 0 B" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Getting info for 'my-bucket'... + name: my-bucket + created: 01-01-2001 + location: WNAM + default_storage_class: Standard + object_count: 0 + bucket_size: 0 B" + `); }); }); @@ -466,7 +472,10 @@ describe("r2", () => { ", "info": "", - "out": "Creating bucket 'test-bucket'... + "out": " + ⛅️ wrangler x.x.x + ────────────────── + Creating bucket 'test-bucket'... ", "warn": "", } @@ -547,7 +556,10 @@ describe("r2", () => { `[APIError: A request to the Cloudflare API (/accounts/some-account-id/r2/buckets/testBucket) failed.]` ); expect(std.out).toMatchInlineSnapshot(` - "Updating bucket testBucket to Foo default storage class. + " + ⛅️ wrangler x.x.x + ────────────────── + Updating bucket testBucket to Foo default storage class. " `); }); @@ -557,9 +569,12 @@ describe("r2", () => { "r2 bucket update storage-class testBucket -s InfrequentAccess" ); expect(std.out).toMatchInlineSnapshot(` - "Updating bucket testBucket to InfrequentAccess default storage class. - Updated bucket testBucket to InfrequentAccess default storage class." - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Updating bucket testBucket to InfrequentAccess default storage class. + Updated bucket testBucket to InfrequentAccess default storage class." + `); }); }); }); @@ -683,9 +698,12 @@ describe("r2", () => { ); await runWrangler(`r2 bucket delete some-bucket`); expect(std.out).toMatchInlineSnapshot(` - "Deleting bucket some-bucket. - Deleted bucket some-bucket." - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Deleting bucket some-bucket. + Deleted bucket some-bucket." + `); }); }); @@ -755,7 +773,12 @@ describe("r2", () => { "r2 bucket sippy enable testBucket --r2-access-key-id=some-key --r2-secret-access-key=some-secret --provider=AWS --access-key-id=aws-key --secret-access-key=aws-secret --region=awsRegion --bucket=awsBucket" ); expect(std.out).toMatchInlineSnapshot( - `"✨ Successfully enabled Sippy on the 'testBucket' bucket."` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Successfully enabled Sippy on the 'testBucket' bucket." + ` ); }); @@ -788,7 +811,12 @@ describe("r2", () => { "r2 bucket sippy enable testBucket --r2-access-key-id=some-key --r2-secret-access-key=some-secret --provider=GCS --client-email=gcs-client-email --private-key=gcs-private-key --bucket=gcsBucket" ); expect(std.out).toMatchInlineSnapshot( - `"✨ Successfully enabled Sippy on the 'testBucket' bucket."` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Successfully enabled Sippy on the 'testBucket' bucket." + ` ); }); @@ -884,7 +912,12 @@ describe("r2", () => { ); await runWrangler("r2 bucket sippy disable testBucket"); expect(std.out).toMatchInlineSnapshot( - `"✨ Successfully disabled Sippy on the 'testBucket' bucket."` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Successfully disabled Sippy on the 'testBucket' bucket." + ` ); }); }); @@ -945,7 +978,12 @@ describe("r2", () => { ); await runWrangler("r2 bucket sippy get testBucket"); expect(std.out).toMatchInlineSnapshot( - `"Sippy configuration: https://storage.googleapis.com/storage/v1/b/testBucket"` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Sippy configuration: https://storage.googleapis.com/storage/v1/b/testBucket" + ` ); }); }); @@ -1005,14 +1043,19 @@ describe("r2", () => { ); await runWrangler("r2 bucket catalog enable testBucket"); expect(std.out).toMatchInlineSnapshot( - `"✨ Successfully enabled data catalog on bucket 'testBucket'. + ` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Successfully enabled data catalog on bucket 'testBucket'. -Catalog URI: 'https://catalog.cloudflarestorage.com/test-account-id/test-warehouse-name' -Warehouse: 'test-account-id_test-warehouse-name' + Catalog URI: 'https://catalog.cloudflarestorage.com/test-account-id/test-warehouse-name' + Warehouse: 'test-account-id_test-warehouse-name' -Use this Catalog URI with Iceberg-compatible query engines (Spark, PyIceberg etc.) to query data as tables. -Note: You will need a Cloudflare API token with 'R2 Data Catalog' permission to authenticate your client with this catalog. -For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/"` + Use this Catalog URI with Iceberg-compatible query engines (Spark, PyIceberg etc.) to query data as tables. + Note: You will need a Cloudflare API token with 'R2 Data Catalog' permission to authenticate your client with this catalog. + For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" + ` ); }); @@ -1096,7 +1139,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); await runWrangler("r2 bucket catalog disable testBucket"); expect(std.out).toMatchInlineSnapshot( - `"Successfully disabled the data catalog on bucket 'testBucket'."` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Successfully disabled the data catalog on bucket 'testBucket'." + ` ); }); @@ -1133,7 +1181,10 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" await runWrangler("r2 bucket catalog disable testBucket"); expect(std.out).toMatchInlineSnapshot(` - "Data catalog is not enabled for bucket 'testBucket'. Please use 'wrangler r2 bucket catalog enable testBucket' to first enable the data catalog on this bucket." + " + ⛅️ wrangler x.x.x + ────────────────── + Data catalog is not enabled for bucket 'testBucket'. Please use 'wrangler r2 bucket catalog enable testBucket' to first enable the data catalog on this bucket." `); }); }); @@ -1194,12 +1245,15 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); await runWrangler("r2 bucket catalog get test-bucket"); expect(std.out).toMatchInlineSnapshot(` - "Getting data catalog status for 'test-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Getting data catalog status for 'test-bucket'... - Catalog URI: https://catalog.cloudflarestorage.com/test-account-id/test-name - Warehouse: test-account-id_test-name - Status: active" - `); + Catalog URI: https://catalog.cloudflarestorage.com/test-account-id/test-name + Warehouse: test-account-id_test-name + Status: active" + `); }); it("should inform user if the catalog was never enabled for the bucket", async () => { @@ -1229,10 +1283,13 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); await runWrangler("r2 bucket catalog get test-bucket"); expect(std.out).toMatchInlineSnapshot(` - "Getting data catalog status for 'test-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Getting data catalog status for 'test-bucket'... - Data catalog is not enabled for bucket 'test-bucket'. Please use 'wrangler r2 bucket catalog enable test-bucket' to first enable the data catalog on this bucket." - `); + Data catalog is not enabled for bucket 'test-bucket'. Please use 'wrangler r2 bucket catalog enable test-bucket' to first enable the data catalog on this bucket." + `); }); }); @@ -1307,7 +1364,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" "r2 bucket catalog compaction enable testBucket --token fakecloudflaretoken --target-size 512" ); expect(std.out).toMatchInlineSnapshot( - `"✨ Successfully enabled file compaction for the data catalog for bucket 'testBucket'."` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Successfully enabled file compaction for the data catalog for bucket 'testBucket'." + ` ); }); @@ -1416,7 +1478,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" "r2 bucket catalog compaction disable testBucket" ); expect(std.out).toMatchInlineSnapshot( - `"Successfully disabled file compaction for the data catalog for bucket 'testBucket'."` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Successfully disabled file compaction for the data catalog for bucket 'testBucket'." + ` ); }); @@ -1429,7 +1496,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" await runWrangler( "r2 bucket catalog compaction disable testBucket" ); - expect(std.out).toMatchInlineSnapshot(`"Disable cancelled."`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + Disable cancelled." + `); }); }); }); @@ -1482,14 +1554,17 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" await runWrangler(`r2 bucket notification list ${bucketName}`) ).toBe(undefined); expect(std.out).toMatchInlineSnapshot(` - "Fetching notification rules for bucket my-bucket... - rule_id: 8cdcce8a-89b3-474f-a087-3eb4fcacfa37 - created_at: 2024-09-05T01:02:03.000Z - queue_name: my-queue - prefix: (all prefixes) - suffix: (all suffixes) - event_type: PutObject,CompleteMultipartUpload,CopyObject" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Fetching notification rules for bucket my-bucket... + rule_id: 8cdcce8a-89b3-474f-a087-3eb4fcacfa37 + created_at: 2024-09-05T01:02:03.000Z + queue_name: my-queue + prefix: (all prefixes) + suffix: (all suffixes) + event_type: PutObject,CompleteMultipartUpload,CopyObject" + `); }); it("is backwards compatible with old API version", async () => { @@ -1548,14 +1623,17 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" await runWrangler(`r2 bucket notification list ${bucketName}`) ).toBe(undefined); expect(std.out).toMatchInlineSnapshot(` - "Fetching notification rules for bucket my-bucket... - rule_id: - created_at: - queue_name: my-queue - prefix: (all prefixes) - suffix: (all suffixes) - event_type: PutObject,CompleteMultipartUpload,CopyObject" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Fetching notification rules for bucket my-bucket... + rule_id: + created_at: + queue_name: my-queue + prefix: (all prefixes) + suffix: (all suffixes) + event_type: PutObject,CompleteMultipartUpload,CopyObject" + `); }); it("shows correct output on error", async () => { @@ -1663,9 +1741,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ) ).resolves.toBe(undefined); expect(std.out).toMatchInlineSnapshot(` - "Creating event notification rule for object creation and deletion (PutObject,CompleteMultipartUpload,CopyObject,DeleteObject,LifecycleDeletion) - Event notification rule created successfully!" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Creating event notification rule for object creation and deletion (PutObject,CompleteMultipartUpload,CopyObject,DeleteObject,LifecycleDeletion) + Event notification rule created successfully!" + `); }); it("follows happy path as expected with prefix", async () => { @@ -1745,9 +1826,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ) ).resolves.toBe(undefined); expect(std.out).toMatchInlineSnapshot(` - "Creating event notification rule for object creation and deletion (PutObject,CompleteMultipartUpload,CopyObject,DeleteObject,LifecycleDeletion) - Event notification rule created successfully!" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Creating event notification rule for object creation and deletion (PutObject,CompleteMultipartUpload,CopyObject,DeleteObject,LifecycleDeletion) + Event notification rule created successfully!" + `); }); it("follows happy path as expected with suffix", async () => { @@ -1827,9 +1911,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ) ).resolves.toBe(undefined); expect(std.out).toMatchInlineSnapshot(` - "Creating event notification rule for object creation and deletion (PutObject,CompleteMultipartUpload,CopyObject,DeleteObject,LifecycleDeletion) - Event notification rule created successfully!" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Creating event notification rule for object creation and deletion (PutObject,CompleteMultipartUpload,CopyObject,DeleteObject,LifecycleDeletion) + Event notification rule created successfully!" + `); }); it("follows happy path as expected with description", async () => { @@ -1915,9 +2002,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ) ).resolves.toBe(undefined); expect(std.out).toMatchInlineSnapshot(` - "Creating event notification rule for object creation and deletion (PutObject,CompleteMultipartUpload,CopyObject,DeleteObject,LifecycleDeletion) - Event notification rule created successfully!" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Creating event notification rule for object creation and deletion (PutObject,CompleteMultipartUpload,CopyObject,DeleteObject,LifecycleDeletion) + Event notification rule created successfully!" + `); }); it("errors if required options are not provided", async () => { @@ -2011,9 +2101,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ) ).resolves.toBe(undefined); expect(std.out).toMatchInlineSnapshot(` - "Deleting event notification rules associated with queue my-queue... - Event notification rule deleted successfully!" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Deleting event notification rules associated with queue my-queue... + Event notification rule deleted successfully!" + `); }); it("follows happy path as expected with specified rules", async () => { @@ -2075,9 +2168,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ) ).resolves.toBe(undefined); expect(std.out).toMatchInlineSnapshot(` - "Deleting event notifications rule \\"rule123456789\\"... - Event notification rule deleted successfully!" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Deleting event notifications rule \\"rule123456789\\"... + Event notification rule deleted successfully!" + `); }); it("errors if required options are not provided", async () => { @@ -2151,7 +2247,10 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket domain get ${bucketName} --domain ${domainName}` ); expect(std.out).toMatchInlineSnapshot(` - "Retrieving custom domain 'test.com' connected to bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Retrieving custom domain 'test.com' connected to bucket 'my-bucket'... domain: test.com enabled: No ownership_status: pending @@ -2159,7 +2258,7 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" min_tls_version: 1.0 zone_id: zone-id-456 zone_name: test-zone" - `); + `); }); }); describe("add", () => { @@ -2198,9 +2297,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket domain add ${bucketName} --domain ${domainName} --zone-id ${zoneId}` ); expect(std.out).toMatchInlineSnapshot(` - "Connecting custom domain 'example.com' to bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Connecting custom domain 'example.com' to bucket 'my-bucket'... ✨ Custom domain 'example.com' connected successfully." - `); + `); }); it("should error if domain and zone-id are not provided", async () => { @@ -2262,7 +2364,10 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); await runWrangler(`r2 bucket domain list ${bucketName}`); expect(std.out).toMatchInlineSnapshot(` - "Listing custom domains connected to bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Listing custom domains connected to bucket 'my-bucket'... domain: example.com enabled: Yes ownership_status: verified @@ -2278,7 +2383,7 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" min_tls_version: 1.0 zone_id: zone-id-456 zone_name: test-zone" - `); + `); }); }); describe("remove", () => { @@ -2313,9 +2418,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket domain remove ${bucketName} --domain ${domainName}` ); expect(std.out).toMatchInlineSnapshot(` - "Removing custom domain 'example.com' from bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Removing custom domain 'example.com' from bucket 'my-bucket'... Custom domain 'example.com' removed successfully." - `); + `); }); }); describe("update", () => { @@ -2348,9 +2456,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket domain update ${bucketName} --domain ${domainName} --min-tls 1.3` ); expect(std.out).toMatchInlineSnapshot(` - "Updating custom domain 'example.com' for bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Updating custom domain 'example.com' for bucket 'my-bucket'... ✨ Custom domain 'example.com' updated successfully." - `); + `); }); }); }); @@ -2380,8 +2491,11 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); await runWrangler(`r2 bucket dev-url get ${bucketName}`); expect(std.out).toMatchInlineSnapshot(` - "Public access is enabled at 'https://pub-bucket-id-123.r2.dev'." - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Public access is enabled at 'https://pub-bucket-id-123.r2.dev'." + `); }); it("should show that public access is disabled when it is disabled", async () => { @@ -2405,8 +2519,11 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); await runWrangler(`r2 bucket dev-url get ${bucketName}`); expect(std.out).toMatchInlineSnapshot(` - "Public access via the r2.dev URL is disabled." - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Public access via the r2.dev URL is disabled." + `); }); }); @@ -2442,9 +2559,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); await runWrangler(`r2 bucket dev-url enable ${bucketName}`); expect(std.out).toMatchInlineSnapshot(` - "Enabling public access for bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Enabling public access for bucket 'my-bucket'... ✨ Public access enabled at 'https://pub-bucket-id-123.r2.dev'." - `); + `); }); }); @@ -2480,9 +2600,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); await runWrangler(`r2 bucket dev-url disable ${bucketName}`); expect(std.out).toMatchInlineSnapshot(` - "Disabling public access for bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Disabling public access for bucket 'my-bucket'... Public access disabled at 'https://pub-bucket-id-123.r2.dev'." - `); + `); }); }); }); @@ -2524,12 +2647,15 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); await runWrangler(`r2 bucket lifecycle list ${bucketName}`); expect(std.out).toMatchInlineSnapshot(` - "Listing lifecycle rules for bucket 'my-bucket'... - name: rule-1 - enabled: Yes - prefix: images/ - action: Expire objects after 30 days" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Listing lifecycle rules for bucket 'my-bucket'... + name: rule-1 + enabled: Yes + prefix: images/ + action: Expire objects after 30 days" + `); }); }); describe("add", () => { @@ -2586,9 +2712,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket lifecycle add ${bucketName} --name ${ruleId} --prefix ${prefix} --expire-days ${conditionValue}` ); expect(std.out).toMatchInlineSnapshot(` - "Adding lifecycle rule 'my-rule' to bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Adding lifecycle rule 'my-rule' to bucket 'my-bucket'... ✨ Added lifecycle rule 'my-rule' to bucket 'my-bucket'." - `); + `); }); it("it should add a date lifecycle rule using command-line arguments and id alias", async () => { @@ -2644,9 +2773,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket lifecycle add ${bucketName} --id ${ruleId} --prefix ${prefix} --expire-date ${conditionValue}` ); expect(std.out).toMatchInlineSnapshot(` - "Adding lifecycle rule 'my-rule' to bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Adding lifecycle rule 'my-rule' to bucket 'my-bucket'... ✨ Added lifecycle rule 'my-rule' to bucket 'my-bucket'." - `); + `); }); }); describe("remove", () => { @@ -2692,9 +2824,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket lifecycle remove ${bucketName} --name ${ruleId}` ); expect(std.out).toMatchInlineSnapshot(` - "Removing lifecycle rule 'my-rule' from bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Removing lifecycle rule 'my-rule' from bucket 'my-bucket'... Lifecycle rule 'my-rule' removed from bucket 'my-bucket'." - `); + `); }); it("should remove a lifecycle rule as expected with id alias", async () => { const bucketName = "my-bucket"; @@ -2738,9 +2873,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket lifecycle remove ${bucketName} --id ${ruleId}` ); expect(std.out).toMatchInlineSnapshot(` - "Removing lifecycle rule 'my-rule' from bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Removing lifecycle rule 'my-rule' from bucket 'my-bucket'... Lifecycle rule 'my-rule' removed from bucket 'my-bucket'." - `); + `); }); it("should handle removing non-existant rule ID as expected", async () => { const bucketName = "my-bucket"; @@ -2818,9 +2956,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket lifecycle set ${bucketName} --file ${filePath}` ); expect(std.out).toMatchInlineSnapshot(` - "Setting lifecycle configuration (1 rules) for bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Setting lifecycle configuration (1 rules) for bucket 'my-bucket'... ✨ Set lifecycle configuration for bucket 'my-bucket'." - `); + `); }); }); }); @@ -2861,13 +3002,16 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); await runWrangler(`r2 bucket cors list ${bucketName}`); expect(std.out).toMatchInlineSnapshot(` - "Listing CORS rules for bucket 'my-bucket'... - allowed_origins: https://www.example.com - allowed_methods: GET, PUT - allowed_headers: Content-Type, Authorization - exposed_headers: ETag, Content-Length - max_age_seconds: 8640" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Listing CORS rules for bucket 'my-bucket'... + allowed_origins: https://www.example.com + allowed_methods: GET, PUT + allowed_headers: Content-Type, Authorization + exposed_headers: ETag, Content-Length + max_age_seconds: 8640" + `); }); }); describe("set", () => { @@ -2917,9 +3061,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket cors set ${bucketName} --file ${filePath}` ); expect(std.out).toMatchInlineSnapshot(` - "Setting CORS configuration (1 rules) for bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Setting CORS configuration (1 rules) for bucket 'my-bucket'... ✨ Set CORS configuration for bucket 'my-bucket'." - `); + `); }); }); describe("delete", () => { @@ -2967,9 +3114,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); await runWrangler(`r2 bucket cors delete ${bucketName}`); expect(std.out).toMatchInlineSnapshot(` - "Deleting the CORS configuration for bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Deleting the CORS configuration for bucket 'my-bucket'... CORS configuration deleted for bucket 'my-bucket'." - `); + `); }); }); }); @@ -3026,22 +3176,25 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); await runWrangler(`r2 bucket lock list ${bucketName}`); expect(std.out).toMatchInlineSnapshot(` - "Listing lock rules for bucket 'my-bucket'... - name: rule-age - enabled: Yes - prefix: images/age - condition: after 1 day - - name: rule-date - enabled: Yes - prefix: images/date - condition: on 2025-01-30 - - name: rule-indefinite - enabled: Yes - prefix: images/indefinite - condition: indefinitely" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Listing lock rules for bucket 'my-bucket'... + name: rule-age + enabled: Yes + prefix: images/age + condition: after 1 day + + name: rule-date + enabled: Yes + prefix: images/date + condition: on 2025-01-30 + + name: rule-indefinite + enabled: Yes + prefix: images/indefinite + condition: indefinitely" + `); }); }); describe("add", () => { @@ -3075,9 +3228,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket lock add ${bucketName} --name "rule-no-prefix" --retention-days 1` ); expect(std.out).toMatchInlineSnapshot(` - "Adding lock rule 'rule-no-prefix' to bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Adding lock rule 'rule-no-prefix' to bucket 'my-bucket'... ✨ Added lock rule 'rule-no-prefix' to bucket 'my-bucket'." - `); + `); }); it("it should fail to add lock rule using command-line arguments without condition", async () => { setIsTTY(true); @@ -3096,8 +3252,11 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket lock add ${bucketName} --name 'rule-not-indefinite' --prefix prefix-not-indefinite` ); expect(std.out).toMatchInlineSnapshot(` - "Add cancelled." - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Add cancelled." + `); }); it("it should add an age lock rule using command-line arguments and id alias", async () => { setIsTTY(true); @@ -3119,9 +3278,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket lock add ${bucketName} --id rule-age --prefix prefix-age --retention-days 1` ); expect(std.out).toMatchInlineSnapshot(` - "Adding lock rule 'rule-age' to bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Adding lock rule 'rule-age' to bucket 'my-bucket'... ✨ Added lock rule 'rule-age' to bucket 'my-bucket'." - `); + `); }); it("it should fail an age lock rule using command-line arguments with invalid age string", async () => { setIsTTY(true); @@ -3181,9 +3343,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket lock add ${bucketName} --name rule-date --prefix prefix-date --retention-date 2025-01-30` ); expect(std.out).toMatchInlineSnapshot(` - "Adding lock rule 'rule-date' to bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Adding lock rule 'rule-date' to bucket 'my-bucket'... ✨ Added lock rule 'rule-date' to bucket 'my-bucket'." - `); + `); }); it("it should fail to add an invalid date lock rule using command-line arguments if retention is not", async () => { setIsTTY(true); @@ -3218,9 +3383,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket lock add ${bucketName} --name rule-indefinite --prefix prefix-indefinite --retention-indefinite` ); expect(std.out).toMatchInlineSnapshot(` - "Adding lock rule 'rule-indefinite' to bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Adding lock rule 'rule-indefinite' to bucket 'my-bucket'... ✨ Added lock rule 'rule-indefinite' to bucket 'my-bucket'." - `); + `); }); it("it should add an indefinite lock rule using command-line arguments and prompt if not initially specified", async () => { setIsTTY(false); @@ -3248,11 +3416,14 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket lock add ${bucketName} --name rule-indefinite --prefix prefix-indefinite` ); expect(std.out).toMatchInlineSnapshot(` - "? Are you sure you want to add lock rule 'rule-indefinite' to bucket 'my-bucket' without retention? The lock rule will apply to all matching objects indefinitely. + " + ⛅️ wrangler x.x.x + ────────────────── + ? Are you sure you want to add lock rule 'rule-indefinite' to bucket 'my-bucket' without retention? The lock rule will apply to all matching objects indefinitely. 🤖 Using fallback value in non-interactive context: yes Adding lock rule 'rule-indefinite' to bucket 'my-bucket'... ✨ Added lock rule 'rule-indefinite' to bucket 'my-bucket'." - `); + `); }); it("it should fail to add a lock rule if retenion is indefinite but false", async () => { setIsTTY(true); @@ -3309,9 +3480,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket lock remove ${bucketName} --name ${ruleId}` ); expect(std.out).toMatchInlineSnapshot(` - "Removing lock rule 'my-rule' from bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Removing lock rule 'my-rule' from bucket 'my-bucket'... Lock rule 'my-rule' removed from bucket 'my-bucket'." - `); + `); }); it("should remove a lock rule as expected with id alias", async () => { const bucketName = "my-bucket"; @@ -3331,9 +3505,12 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket lock remove ${bucketName} --id ${ruleId}` ); expect(std.out).toMatchInlineSnapshot(` - "Removing lock rule 'my-rule' from bucket 'my-bucket'... + " + ⛅️ wrangler x.x.x + ────────────────── + Removing lock rule 'my-rule' from bucket 'my-bucket'... Lock rule 'my-rule' removed from bucket 'my-bucket'." - `); + `); }); it("should handle removing non-existant rule ID as expected", async () => { const bucketName = "my-bucket"; @@ -3401,11 +3578,14 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" `r2 bucket lock set ${bucketName} --file ${filePath}` ); expect(std.out).toMatchInlineSnapshot(` - "? Are you sure you want to overwrite all existing lock rules for bucket 'my-bucket'? + " + ⛅️ wrangler x.x.x + ────────────────── + ? Are you sure you want to overwrite all existing lock rules for bucket 'my-bucket'? 🤖 Using fallback value in non-interactive context: yes Setting lock configuration (2 rules) for bucket 'my-bucket'... ✨ Set lock configuration for bucket 'my-bucket'." - `); + `); }); }); }); @@ -3445,7 +3625,10 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Downloading \\"wormhole-img.png\\" from \\"bucket-object-test\\". Download complete." `); @@ -3467,7 +3650,10 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Creating object \\"wormhole-img.png\\" in bucket \\"bucket-object-test\\". Upload complete." `); @@ -3480,7 +3666,10 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Creating object \\"wormhole-img.png\\" with InfrequentAccess storage class in bucket \\"bucket-object-test\\". Upload complete." `); @@ -3560,7 +3749,10 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Creating object \\"wormhole-img.png\\" in bucket \\"bucket-object-test\\". Upload complete." `); @@ -3572,7 +3764,10 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/" ); expect(std.out).toMatchInlineSnapshot(` - "Resource location: remote + " + ⛅️ wrangler x.x.x + ────────────────── + Resource location: remote Deleting object \\"wormhole-img.png\\" from bucket \\"bucket-object-test\\". Delete complete." `); diff --git a/packages/wrangler/src/__tests__/r2/bucket.test.ts b/packages/wrangler/src/__tests__/r2/bucket.test.ts index eebb3546fa..a9b74d62b7 100644 --- a/packages/wrangler/src/__tests__/r2/bucket.test.ts +++ b/packages/wrangler/src/__tests__/r2/bucket.test.ts @@ -4,8 +4,6 @@ import { requireAuth } from "../../user"; import { mockConsoleMethods } from "../helpers/mock-console"; import { runWrangler } from "../helpers/run-wrangler"; -vi.unmock("../../wrangler-banner"); - vi.mock("../../r2/helpers"); vi.mock("../../user"); diff --git a/packages/wrangler/src/__tests__/r2/pipe.test.ts b/packages/wrangler/src/__tests__/r2/pipe.test.ts index 8c0f0b8e40..45524aed8f 100644 --- a/packages/wrangler/src/__tests__/r2/pipe.test.ts +++ b/packages/wrangler/src/__tests__/r2/pipe.test.ts @@ -3,7 +3,6 @@ import { mockConsoleMethods } from "../helpers/mock-console"; import { runInTempDir } from "../helpers/run-in-tmp"; import { runWrangler } from "../helpers/run-wrangler"; -vi.unmock("../../wrangler-banner"); const decoder = new TextDecoder(); describe("pipe test", () => { const consoleSpy = mockConsoleMethods(); diff --git a/packages/wrangler/src/__tests__/secret.test.ts b/packages/wrangler/src/__tests__/secret.test.ts index cbc12d3541..48d6d4e3f8 100644 --- a/packages/wrangler/src/__tests__/secret.test.ts +++ b/packages/wrangler/src/__tests__/secret.test.ts @@ -82,8 +82,6 @@ function mockNoWorkerFound(isBulk = false) { } } -vi.unmock("../wrangler-banner"); - describe("wrangler secret", () => { const std = mockConsoleMethods(); const { setIsTTY } = useMockIsTTY(); diff --git a/packages/wrangler/src/__tests__/secrets-store.test.ts b/packages/wrangler/src/__tests__/secrets-store.test.ts index e99e1010d4..714365fea2 100644 --- a/packages/wrangler/src/__tests__/secrets-store.test.ts +++ b/packages/wrangler/src/__tests__/secrets-store.test.ts @@ -106,9 +106,12 @@ describe("secrets-store store commands", () => { `); expect(std.out).toMatchInlineSnapshot(` - "🔐 Creating store... (Name: test-store) -✅ Created store! (Name: test-store, ID: 8b9199cad1954bc39add51c948767679)" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + 🔐 Creating store... (Name: test-store) + ✅ Created store! (Name: test-store, ID: 8b9199cad1954bc39add51c948767679)" + `); }); it("errors in creating a store when no name passed", async () => { @@ -130,7 +133,10 @@ describe("secrets-store store commands", () => { await runWrangler("secrets-store store list --remote"); expect(std.out).toMatchInlineSnapshot(` - "🔐 Listing stores... + " + ⛅️ wrangler x.x.x + ────────────────── + 🔐 Listing stores... ┌─┬─┬─┬─┬─┐ │ Name │ ID │ AccountID │ Created │ Modified │ ├─┼─┼─┼─┼─┤ @@ -212,6 +218,9 @@ describe("secrets-store secret commands", () => { expect(std.out).toMatchInlineSnapshot(` " + ⛅️ wrangler x.x.x + ────────────────── + 🔐 Creating secret... (Name: TEST_SECRET, Value: REDACTED, Scopes: workers, Comment: wrangler secret) ✅ Created secret! (ID: 36dabbe4d01c49de82847b9a22673cbd) ┌─┬─┬─┬─┬─┬─┬─┬─┐ @@ -313,7 +322,10 @@ describe("secrets-store secret commands", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🔐 Listing secrets... (store-id: 850e0805c1084551bb46d150b5dfe414, page: 1, per-page: 10) + " + ⛅️ wrangler x.x.x + ────────────────── + 🔐 Listing secrets... (store-id: 850e0805c1084551bb46d150b5dfe414, page: 1, per-page: 10) ┌─┬─┬─┬─┬─┬─┬─┐ │ Name │ ID │ Comment │ Scopes │ Status │ Created │ Modified │ ├─┼─┼─┼─┼─┼─┼─┤ @@ -363,7 +375,10 @@ describe("secrets-store secret commands", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🔐 Getting secret... (ID: df3f6eb1159a4f10ac5fe836e2b8169c) + " + ⛅️ wrangler x.x.x + ────────────────── + 🔐 Getting secret... (ID: df3f6eb1159a4f10ac5fe836e2b8169c) ┌─┬─┬─┬─┬─┬─┬─┬─┐ │ Name │ ID │ StoreID │ Comment │ Scopes │ Status │ Created │ Modified │ ├─┼─┼─┼─┼─┼─┼─┼─┤ @@ -409,9 +424,12 @@ describe("secrets-store secret commands", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🔐 Deleting secret... (ID: df3f6eb1159a4f10ac5fe836e2b8169c) -✅ Deleted secret! (ID: df3f6eb1159a4f10ac5fe836e2b8169c)" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + 🔐 Deleting secret... (ID: df3f6eb1159a4f10ac5fe836e2b8169c) + ✅ Deleted secret! (ID: df3f6eb1159a4f10ac5fe836e2b8169c)" + `); }); it("errors in deleting a secret when no store-id passed", async () => { @@ -478,7 +496,10 @@ describe("secrets-store secret commands", () => { `); expect(std.out).toMatchInlineSnapshot(` - "🔐 Updating secret... (ID: df3f6eb1159a4f10ac5fe836e2b8169c) + " + ⛅️ wrangler x.x.x + ────────────────── + 🔐 Updating secret... (ID: df3f6eb1159a4f10ac5fe836e2b8169c) ✅ Updated secret! (ID: 36dabbe4d01c49de82847b9a22673cbd) ┌─┬─┬─┬─┬─┬─┬─┬─┐ │ Name │ ID │ StoreID │ Comment │ Scopes │ Status │ Created │ Modified │ @@ -580,7 +601,10 @@ describe("secrets-store secret commands", () => { `); expect(std.out).toMatchInlineSnapshot(` - "🔐 Duplicating secret... (ID: df3f6eb1159a4f10ac5fe836e2b8169c) + " + ⛅️ wrangler x.x.x + ────────────────── + 🔐 Duplicating secret... (ID: df3f6eb1159a4f10ac5fe836e2b8169c) ✅ Duplicated secret! (ID: 36dabbe4d01c49de82847b9a22673cbd) ┌─┬─┬─┬─┬─┬─┬─┬─┐ │ Name │ ID │ StoreID │ Comment │ Scopes │ Status │ Created │ Modified │ diff --git a/packages/wrangler/src/__tests__/sentry.test.ts b/packages/wrangler/src/__tests__/sentry.test.ts index 80f5855258..04c6a28125 100644 --- a/packages/wrangler/src/__tests__/sentry.test.ts +++ b/packages/wrangler/src/__tests__/sentry.test.ts @@ -64,7 +64,10 @@ describe("sentry", () => { `[TypeError: Failed to fetch]` ); expect(std.out).toMatchInlineSnapshot(` - "Getting User settings... + " + ⛅️ wrangler x.x.x + ────────────────── + Getting User settings... If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose ? Would you like to report this error to Cloudflare? Wrangler's output and the error details will be shared with the Wrangler team to help us diagnose and fix the issue. @@ -90,7 +93,12 @@ describe("sentry", () => { await expect(runWrangler("delete")).rejects.toMatchInlineSnapshot( `[Error: A worker name must be defined, either via --name, or in your Wrangler configuration file]` ); - expect(std.out).toMatchInlineSnapshot(`""`); + expect(std.out).toMatchInlineSnapshot(` + " + ⛅️ wrangler x.x.x + ────────────────── + " + `); expect(sentryRequests?.length).toEqual(0); }); @@ -116,10 +124,13 @@ describe("sentry", () => { `[TypeError: Failed to fetch]` ); expect(std.out).toMatchInlineSnapshot(` - "Getting User settings... + " + ⛅️ wrangler x.x.x + ────────────────── + Getting User settings... - If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose" - `); + If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose" + `); expect(sentryRequests?.length).toEqual(0); }); @@ -141,10 +152,13 @@ describe("sentry", () => { runWrangler("whoami", { WRANGLER_SEND_ERROR_REPORTS: "false" }) ).rejects.toMatchInlineSnapshot(`[TypeError: Failed to fetch]`); expect(std.out).toMatchInlineSnapshot(` - "Getting User settings... + " + ⛅️ wrangler x.x.x + ────────────────── + Getting User settings... - If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose" - `); + If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose" + `); expect(sentryRequests?.length).toEqual(0); }); @@ -170,10 +184,13 @@ describe("sentry", () => { `[TypeError: Failed to fetch]` ); expect(std.out).toMatchInlineSnapshot(` - "Getting User settings... + " + ⛅️ wrangler x.x.x + ────────────────── + Getting User settings... - If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose" - `); + If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose" + `); // Sentry sends multiple HTTP requests to capture breadcrumbs expect(sentryRequests?.length).toBeGreaterThan(0); @@ -472,10 +489,13 @@ describe("sentry", () => { runWrangler("whoami", { WRANGLER_SEND_ERROR_REPORTS: "true" }) ).rejects.toMatchInlineSnapshot(`[TypeError: Failed to fetch]`); expect(std.out).toMatchInlineSnapshot(` - "Getting User settings... + " + ⛅️ wrangler x.x.x + ────────────────── + Getting User settings... - If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose" - `); + If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose" + `); // Sentry sends multiple HTTP requests to capture breadcrumbs expect(sentryRequests?.length).toBeGreaterThan(0); diff --git a/packages/wrangler/src/__tests__/tail.test.ts b/packages/wrangler/src/__tests__/tail.test.ts index 1064fe6c46..a3e2c87708 100644 --- a/packages/wrangler/src/__tests__/tail.test.ts +++ b/packages/wrangler/src/__tests__/tail.test.ts @@ -52,10 +52,6 @@ vi.mock("ws", async (importOriginal) => { return module; }); -// we want to include the banner to make sure it doesn't show up in the output when -// when --format=json -vi.unmock("../wrangler-banner"); - describe("tail", () => { mockAccountId(); mockApiToken(); diff --git a/packages/wrangler/src/__tests__/type-generation.test.ts b/packages/wrangler/src/__tests__/type-generation.test.ts index 698ee243e2..f46da3f682 100644 --- a/packages/wrangler/src/__tests__/type-generation.test.ts +++ b/packages/wrangler/src/__tests__/type-generation.test.ts @@ -381,7 +381,10 @@ describe("generate types", () => { outFile: "worker-configuration.d.ts", }); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface Env { @@ -401,6 +404,9 @@ describe("generate types", () => { https://developers.cloudflare.com/workers/languages/typescript/#generate-types 📣 Remember to rerun 'wrangler types' after you change your wrangler.json file. + + ⛅️ wrangler x.x.x + ────────────────── Generating project types... declare namespace Cloudflare { @@ -421,6 +427,9 @@ describe("generate types", () => { https://developers.cloudflare.com/workers/languages/typescript/#generate-types 📣 Remember to rerun 'wrangler types' after you change your wrangler.json file. + + ⛅️ wrangler x.x.x + ────────────────── Generating project types... declare namespace Cloudflare { @@ -468,7 +477,10 @@ describe("generate types", () => { await runWrangler("types --include-runtime=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface GlobalProps { @@ -568,7 +580,10 @@ describe("generate types", () => { await runWrangler("types --include-runtime=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface GlobalProps { @@ -731,7 +746,10 @@ describe("generate types", () => { "types --include-runtime=false -c a/wrangler.jsonc -c b/wrangler.jsonc -c c/wrangler.jsonc --path a/worker-configuration.d.ts" ); expect(std.out).toMatchInlineSnapshot(` - "- Found Worker 'service_name' at 'b/index.ts' (b/wrangler.jsonc) + " + ⛅️ wrangler x.x.x + ────────────────── + - Found Worker 'service_name' at 'b/index.ts' (b/wrangler.jsonc) - Found Worker 'service_name_2' at 'c/index.ts' (c/wrangler.jsonc) Generating project types... @@ -868,7 +886,10 @@ describe("generate types", () => { await runWrangler("types --include-runtime=false"); expect(fs.existsSync("./worker-configuration.d.ts")).toBe(false); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... No project types to add. @@ -902,7 +923,10 @@ describe("generate types", () => { " `); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... No project types to add. @@ -935,7 +959,10 @@ describe("generate types", () => { await runWrangler("types --include-runtime=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface GlobalProps { @@ -1002,7 +1029,10 @@ describe("generate types", () => { await runWrangler("types --include-runtime=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... export {}; declare global { @@ -1030,7 +1060,10 @@ describe("generate types", () => { await runWrangler("types"); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface Env { @@ -1069,7 +1102,10 @@ describe("generate types", () => { await runWrangler("types --include-runtime=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface Env { @@ -1123,7 +1159,10 @@ describe("generate types", () => { await runWrangler("types --include-runtime=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface Env { @@ -1168,7 +1207,10 @@ describe("generate types", () => { await runWrangler("types --include-runtime=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface Env { @@ -1206,7 +1248,10 @@ describe("generate types", () => { await runWrangler("types --strict-vars=false --include-runtime=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface Env { @@ -1248,7 +1293,10 @@ describe("generate types", () => { await runWrangler("types --include-runtime=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface Env { @@ -1287,7 +1335,10 @@ describe("generate types", () => { await runWrangler("types --include-runtime=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface Env { @@ -1349,7 +1400,10 @@ describe("generate types", () => { await runWrangler("types --include-runtime=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface Env { @@ -1373,7 +1427,10 @@ describe("generate types", () => { await runWrangler("types --strict-vars=false --include-runtime=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface Env { @@ -1409,7 +1466,10 @@ describe("generate types", () => { "types --include-runtime=false --env-interface CloudflareEnv" ); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface Env { @@ -1619,7 +1679,10 @@ describe("generate types", () => { ); await runWrangler("types --include-env=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating runtime types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating runtime types... Runtime types generated. @@ -1652,7 +1715,10 @@ describe("generate types", () => { fs.writeFileSync("./.wrangler/types/runtime.d.ts", "blah"); await runWrangler("types --include-env=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating runtime types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating runtime types... Runtime types generated. @@ -1698,7 +1764,10 @@ describe("generate types", () => { await runWrangler("types --include-runtime=false"); expect(std.out).toMatchInlineSnapshot(` - "Generating project types... + " + ⛅️ wrangler x.x.x + ────────────────── + Generating project types... declare namespace Cloudflare { interface GlobalProps { diff --git a/packages/wrangler/src/__tests__/user.test.ts b/packages/wrangler/src/__tests__/user.test.ts index 255593dfe2..4f4e8dc98e 100644 --- a/packages/wrangler/src/__tests__/user.test.ts +++ b/packages/wrangler/src/__tests__/user.test.ts @@ -68,7 +68,10 @@ describe("User", () => { expect(counter).toBe(1); expect(std.out).toMatchInlineSnapshot(` - "Attempting to login via OAuth... + " + ⛅️ wrangler x.x.x + ────────────────── + Attempting to login via OAuth... Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20secrets_store%3Awrite%20containers%3Awrite%20cloudchamber%3Awrite%20connectivity%3Aadmin%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256 Successfully logged in." `); @@ -106,7 +109,10 @@ describe("User", () => { expect(counter).toBe(1); expect(std.out).toMatchInlineSnapshot(` - "Attempting to login via OAuth... + " + ⛅️ wrangler x.x.x + ────────────────── + Attempting to login via OAuth... Temporary login server listening on 0.0.0.0:8976 Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2F0.0.0.0%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20secrets_store%3Awrite%20containers%3Awrite%20cloudchamber%3Awrite%20connectivity%3Aadmin%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256 Successfully logged in." @@ -145,7 +151,10 @@ describe("User", () => { expect(counter).toBe(1); expect(std.out).toMatchInlineSnapshot(` - "Attempting to login via OAuth... + " + ⛅️ wrangler x.x.x + ────────────────── + Attempting to login via OAuth... Temporary login server listening on localhost:8787 Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8787%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20secrets_store%3Awrite%20containers%3Awrite%20cloudchamber%3Awrite%20connectivity%3Aadmin%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256 Successfully logged in." @@ -185,7 +194,10 @@ describe("User", () => { expect(counter).toBe(1); expect(std.out).toMatchInlineSnapshot(` - "Attempting to login via OAuth... + " + ⛅️ wrangler x.x.x + ────────────────── + Attempting to login via OAuth... Opening a link in your default browser: https://dash.staging.cloudflare.com/oauth2/auth?response_type=code&client_id=4b2ea6cc-9421-4761-874b-ce550e0e3def&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20secrets_store%3Awrite%20containers%3Awrite%20cloudchamber%3Awrite%20connectivity%3Aadmin%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256 Successfully logged in." `); @@ -301,7 +313,10 @@ describe("User", () => { expect(counter).toBe(1); expect(std.out).toMatchInlineSnapshot(` - "Attempting to login via OAuth... + " + ⛅️ wrangler x.x.x + ────────────────── + Attempting to login via OAuth... Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20ai%3Awrite%20queues%3Awrite%20pipelines%3Awrite%20secrets_store%3Awrite%20containers%3Awrite%20cloudchamber%3Awrite%20connectivity%3Aadmin%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256 Successfully logged in." `); diff --git a/packages/wrangler/src/__tests__/vectorize/vectorize.test.ts b/packages/wrangler/src/__tests__/vectorize/vectorize.test.ts index 7d526b1abe..382c94d121 100644 --- a/packages/wrangler/src/__tests__/vectorize/vectorize.test.ts +++ b/packages/wrangler/src/__tests__/vectorize/vectorize.test.ts @@ -199,7 +199,10 @@ describe("vectorize commands", () => { " `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating index: 'some-index' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating index: 'some-index' ✅ Successfully created a new Vectorize index: 'test-index' To access your new Vectorize Index in your Worker, add the following snippet to your configuration file: { @@ -219,7 +222,10 @@ describe("vectorize commands", () => { "vectorize create test-index --dimensions=1536 --metric=euclidean" ); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating index: 'test-index' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating index: 'test-index' ✅ Successfully created a new Vectorize index: 'test-index' To access your new Vectorize Index in your Worker, add the following snippet to your configuration file: { @@ -239,7 +245,10 @@ describe("vectorize commands", () => { "vectorize create test-index --preset=openai/text-embedding-ada-002" ); expect(std.out).toMatchInlineSnapshot(` - "Configuring index based for the embedding model openai/text-embedding-ada-002. + " + ⛅️ wrangler x.x.x + ────────────────── + Configuring index based for the embedding model openai/text-embedding-ada-002. 🚧 Creating index: 'test-index' ✅ Successfully created a new Vectorize index: 'test-index' To access your new Vectorize Index in your Worker, add the following snippet to your configuration file: @@ -312,7 +321,10 @@ describe("vectorize commands", () => { mockVectorizeRequest(); await runWrangler("vectorize list --deprecated-v1=true"); expect(std.out).toMatchInlineSnapshot(` - "📋 Listing Vectorize indexes... + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Listing Vectorize indexes... ┌─┬─┬─┬─┬─┬─┐ │ name │ dimensions │ metric │ description │ created │ modified │ ├─┼─┼─┼─┼─┼─┤ @@ -327,7 +339,10 @@ describe("vectorize commands", () => { mockVectorizeV2Request(); await runWrangler("vectorize list"); expect(std.out).toMatchInlineSnapshot(` - "📋 Listing Vectorize indexes... + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Listing Vectorize indexes... ┌─┬─┬─┬─┬─┬─┐ │ name │ dimensions │ metric │ description │ created │ modified │ ├─┼─┼─┼─┼─┼─┤ @@ -342,7 +357,10 @@ describe("vectorize commands", () => { mockVectorizeV2RequestError(); await runWrangler("vectorize list"); expect(std.out).toMatchInlineSnapshot(` - "📋 Listing Vectorize indexes..." + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Listing Vectorize indexes..." `); expect(std.warn).toMatchInlineSnapshot(` @@ -362,7 +380,10 @@ describe("vectorize commands", () => { mockVectorizeRequest(); await runWrangler("vectorize get test-index --deprecated-v1=true"); expect(std.out).toMatchInlineSnapshot(` - "┌─┬─┬─┬─┬─┬─┐ + " + ⛅️ wrangler x.x.x + ────────────────── + ┌─┬─┬─┬─┬─┬─┐ │ name │ dimensions │ metric │ description │ created │ modified │ ├─┼─┼─┼─┼─┼─┤ │ test-index │ 768 │ cosine │ │ 2023-09-25T13:02:18.00268Z │ 2023-09-25T13:02:18.00268Z │ @@ -374,7 +395,10 @@ describe("vectorize commands", () => { mockVectorizeV2Request(); await runWrangler("vectorize get test-index"); expect(std.out).toMatchInlineSnapshot(` - "┌─┬─┬─┬─┬─┬─┐ + " + ⛅️ wrangler x.x.x + ────────────────── + ┌─┬─┬─┬─┬─┬─┐ │ name │ dimensions │ metric │ description │ created │ modified │ ├─┼─┼─┼─┼─┼─┤ │ test-index │ 1536 │ euclidean │ test-desc │ 2024-07-11T13:02:18.00268Z │ 2024-07-11T13:02:18.00268Z │ @@ -390,9 +414,12 @@ describe("vectorize commands", () => { }); await runWrangler("vectorize delete test-index --deprecated-v1=true"); expect(std.out).toMatchInlineSnapshot(` - "Deleting Vectorize index test-index - ✅ Deleted index test-index" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + Deleting Vectorize index test-index + ✅ Deleted index test-index" + `); }); it("should handle a delete on a vectorize index", async () => { @@ -403,8 +430,11 @@ describe("vectorize commands", () => { }); await runWrangler("vectorize delete test-index"); expect(std.out).toMatchInlineSnapshot(` - "Deleting Vectorize index test-index - ✅ Deleted index test-index" + " + ⛅️ wrangler x.x.x + ────────────────── + Deleting Vectorize index test-index + ✅ Deleted index test-index" `); }); @@ -412,36 +442,39 @@ describe("vectorize commands", () => { mockVectorizeV2Request(); await runWrangler("vectorize get-vectors test-index --ids a 'b'"); expect(std.out).toMatchInlineSnapshot(` - "📋 Fetching vectors... -[ - { - \\"id\\": \\"a\\", - \\"values\\": [ - 1, - 2, - 3, - 4 - ], - \\"namespace\\": \\"abcd\\", - \\"metadata\\": { - \\"a\\": true, - \\"b\\": 123 - } - }, - { - \\"id\\": \\"b\\", - \\"values\\": [ - 5, - 6, - 7, - 8 - ], - \\"metadata\\": { - \\"c\\": false, - \\"b\\": \\"123\\" - } - } -]" + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Fetching vectors... + [ + { + \\"id\\": \\"a\\", + \\"values\\": [ + 1, + 2, + 3, + 4 + ], + \\"namespace\\": \\"abcd\\", + \\"metadata\\": { + \\"a\\": true, + \\"b\\": 123 + } + }, + { + \\"id\\": \\"b\\", + \\"values\\": [ + 5, + 6, + 7, + 8 + ], + \\"metadata\\": { + \\"c\\": false, + \\"b\\": \\"123\\" + } + } + ]" `); }); @@ -449,7 +482,10 @@ describe("vectorize commands", () => { mockVectorizeV2RequestError(); await runWrangler("vectorize get-vectors test-index --ids a 'b'"); expect(std.out).toMatchInlineSnapshot(` - "📋 Fetching vectors..." + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Fetching vectors..." `); expect(std.warn).toMatchInlineSnapshot(` @@ -473,7 +509,10 @@ describe("vectorize commands", () => { mockVectorizeV2Request(); await runWrangler("vectorize delete-vectors test-index --ids a 'b'"); expect(std.out).toMatchInlineSnapshot(` - "📋 Deleting vectors... + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Deleting vectors... ✅ Successfully enqueued 2 vectors into index 'test-index' for deletion. Mutation changeset identifier: xxxxxx-xxxx-xxxx-xxxx-xxxxxx." `); }); @@ -494,13 +533,91 @@ describe("vectorize commands", () => { await runWrangler( "vectorize query test-index --vector 1 2 3 '4' 1.5 '2.6' a 'b' null 7 abc 8 undefined" ); - expect(std.out).toMatchInlineSnapshot(querySnapshot); + expect(std.out).toMatchInlineSnapshot(querySnapshot` + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Searching for relevant vectors... + { + \\"count\\": 2, + \\"matches\\": [ + { + \\"id\\": \\"a\\", + \\"score\\": 0.5, + \\"values\\": [ + 1, + 2, + 3, + 4 + ], + \\"namespace\\": \\"abcd\\", + \\"metadata\\": { + \\"a\\": true, + \\"b\\": 123 + } + }, + { + \\"id\\": \\"b\\", + \\"score\\": 0.75, + \\"values\\": [ + 5, + 6, + 7, + 8 + ], + \\"metadata\\": { + \\"c\\": false, + \\"b\\": \\"123\\" + } + } + ] + }" + `); }); it("should handle a query with a vector-id", async () => { mockVectorizeV2Request(); await runWrangler("vectorize query test-index --vector-id some-vector-id"); - expect(std.out).toMatchInlineSnapshot(querySnapshot); + expect(std.out).toMatchInlineSnapshot(querySnapshot` + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Searching for relevant vectors... + { + \\"count\\": 2, + \\"matches\\": [ + { + \\"id\\": \\"a\\", + \\"score\\": 0.5, + \\"values\\": [ + 1, + 2, + 3, + 4 + ], + \\"namespace\\": \\"abcd\\", + \\"metadata\\": { + \\"a\\": true, + \\"b\\": 123 + } + }, + { + \\"id\\": \\"b\\", + \\"score\\": 0.75, + \\"values\\": [ + 5, + 6, + 7, + 8 + ], + \\"metadata\\": { + \\"c\\": false, + \\"b\\": \\"123\\" + } + } + ] + }" + `); // No warning or error expect(std.warn).toMatchInlineSnapshot(`""`); @@ -512,7 +629,46 @@ describe("vectorize commands", () => { await runWrangler( `vectorize query test-index --vector 1 2 3 '4' --top-k=2 --return-values=true --return-metadata=indexed --namespace=abc --filter '{ "p1": "abc", "p2": { "$ne": true }, "p3": 10, "p4": false, "nested.p5": "abcd" }'` ); - expect(std.out).toMatchInlineSnapshot(querySnapshot); + expect(std.out).toMatchInlineSnapshot(querySnapshot` + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Searching for relevant vectors... + { + \\"count\\": 2, + \\"matches\\": [ + { + \\"id\\": \\"a\\", + \\"score\\": 0.5, + \\"values\\": [ + 1, + 2, + 3, + 4 + ], + \\"namespace\\": \\"abcd\\", + \\"metadata\\": { + \\"a\\": true, + \\"b\\": 123 + } + }, + { + \\"id\\": \\"b\\", + \\"score\\": 0.75, + \\"values\\": [ + 5, + 6, + 7, + 8 + ], + \\"metadata\\": { + \\"c\\": false, + \\"b\\": \\"123\\" + } + } + ] + }" + `); // No warning > Valid filter expect(std.warn).toMatchInlineSnapshot(`""`); @@ -523,7 +679,46 @@ describe("vectorize commands", () => { await runWrangler( "vectorize query test-index --vector 1 2 3 '4' --filter='{ 'p1': [1,2,3] }'" ); - expect(std.out).toMatchInlineSnapshot(querySnapshot); + expect(std.out).toMatchInlineSnapshot(querySnapshot` + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Searching for relevant vectors... + { + \\"count\\": 2, + \\"matches\\": [ + { + \\"id\\": \\"a\\", + \\"score\\": 0.5, + \\"values\\": [ + 1, + 2, + 3, + 4 + ], + \\"namespace\\": \\"abcd\\", + \\"metadata\\": { + \\"a\\": true, + \\"b\\": 123 + } + }, + { + \\"id\\": \\"b\\", + \\"score\\": 0.75, + \\"values\\": [ + 5, + 6, + 7, + 8 + ], + \\"metadata\\": { + \\"c\\": false, + \\"b\\": \\"123\\" + } + } + ] + }" + `); expect(std.warn).toMatchInlineSnapshot(` "▲ [WARNING] 🚨 Invalid query filter. Please use the recommended format. @@ -536,7 +731,10 @@ describe("vectorize commands", () => { mockVectorizeV2RequestError(); await runWrangler("vectorize query test-index --vector 1 2 3 '4'"); expect(std.out).toMatchInlineSnapshot(` - "📋 Searching for relevant vectors..." + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Searching for relevant vectors..." `); expect(std.warn).toMatchInlineSnapshot(` @@ -591,7 +789,10 @@ describe("vectorize commands", () => { mockVectorizeV2Request(); await runWrangler("vectorize info test-index"); expect(std.out).toMatchInlineSnapshot(` - "📋 Fetching index info... + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Fetching index info... ┌─┬─┬─┬─┐ │ dimensions │ vectorCount │ processedUpToMutation │ processedUpToDatetime │ ├─┼─┼─┼─┤ @@ -606,7 +807,10 @@ describe("vectorize commands", () => { `vectorize create-metadata-index test-index --property-name='some-prop' --type='string'` ); expect(std.out).toMatchInlineSnapshot(` - "📋 Creating metadata index... + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Creating metadata index... ✅ Successfully enqueued metadata index creation request. Mutation changeset identifier: xxxxxx-xxxx-xxxx-xxxx-xxxxxx." `); }); @@ -633,7 +837,10 @@ describe("vectorize commands", () => { mockVectorizeV2Request(); await runWrangler(`vectorize list-metadata-index test-index`); expect(std.out).toMatchInlineSnapshot(` - "📋 Fetching metadata indexes... + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Fetching metadata indexes... ┌─┬─┐ │ propertyName │ type │ ├─┼─┤ @@ -650,7 +857,10 @@ describe("vectorize commands", () => { mockVectorizeV2RequestError(); await runWrangler("vectorize list-metadata-index test-index"); expect(std.out).toMatchInlineSnapshot(` - "📋 Fetching metadata indexes..." + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Fetching metadata indexes..." `); expect(std.warn).toMatchInlineSnapshot(` @@ -672,7 +882,10 @@ describe("vectorize commands", () => { `vectorize delete-metadata-index test-index --property-name='some-prop'` ); expect(std.out).toMatchInlineSnapshot(` - "📋 Deleting metadata index... + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Deleting metadata index... ✅ Successfully enqueued metadata index deletion request. Mutation changeset identifier: xxxxxx-xxxx-xxxx-xxxx-xxxxxx." `); }); @@ -720,7 +933,10 @@ describe("vectorize commands", () => { mockVectorizeV2Request(); await runWrangler("vectorize list-vectors test-index"); expect(std.out).toMatchInlineSnapshot(` - "📋 Listing vectors in index 'test-index'... + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Listing vectors in index 'test-index'... ┌─┬─┐ │ # │ Vector ID │ ├─┼─┤ @@ -742,7 +958,10 @@ describe("vectorize commands", () => { mockVectorizeV2Request(); await runWrangler("vectorize list-vectors test-index --count 2"); expect(std.out).toMatchInlineSnapshot(` - "📋 Listing vectors in index 'test-index'... + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Listing vectors in index 'test-index'... ┌─┬─┐ │ # │ Vector ID │ ├─┼─┤ @@ -764,7 +983,10 @@ describe("vectorize commands", () => { "vectorize list-vectors test-index --cursor next-page-cursor" ); expect(std.out).toMatchInlineSnapshot(` - "📋 Listing vectors in index 'test-index'... + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Listing vectors in index 'test-index'... ┌─┬─┐ │ # │ Vector ID │ ├─┼─┤ @@ -806,7 +1028,10 @@ describe("vectorize commands", () => { mockVectorizeV2RequestError(); await runWrangler("vectorize list-vectors test-index"); expect(std.out).toMatchInlineSnapshot(` - "📋 Listing vectors in index 'test-index'..." + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Listing vectors in index 'test-index'..." `); expect(std.warn).toMatchInlineSnapshot(` diff --git a/packages/wrangler/src/__tests__/vectorize/vectorize.upsert.test.ts b/packages/wrangler/src/__tests__/vectorize/vectorize.upsert.test.ts index 2e59dceec4..2e4e63b89c 100644 --- a/packages/wrangler/src/__tests__/vectorize/vectorize.upsert.test.ts +++ b/packages/wrangler/src/__tests__/vectorize/vectorize.upsert.test.ts @@ -101,10 +101,13 @@ describe("dataset upsert", () => { expect(insertRequestCount).toBe(2); expect(std.out).toMatchInlineSnapshot(` - "✨ Uploading vector batch (3 vectors) - ✨ Uploading vector batch (2 vectors) - ✅ Successfully inserted 5 vectors into index 'my-index'" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Uploading vector batch (3 vectors) + ✨ Uploading vector batch (2 vectors) + ✅ Successfully inserted 5 vectors into index 'my-index'" + `); }); it("should batch uploads in ndjson format for Vectorize", async () => { @@ -159,10 +162,13 @@ describe("dataset upsert", () => { expect(insertRequestCount).toBe(2); expect(std.out).toMatchInlineSnapshot(` - "✨ Enqueued 3 vectors into index 'my-index' for insertion. Mutation changeset identifier: ${mutationId} - ✨ Enqueued 2 vectors into index 'my-index' for insertion. Mutation changeset identifier: ${mutationId} - ✅ Successfully enqueued 5 vectors into index 'my-index' for insertion." - `); + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Enqueued 3 vectors into index 'my-index' for insertion. Mutation changeset identifier: a5c71e2f-74a1-4536-92d2-9ba58d662161 + ✨ Enqueued 2 vectors into index 'my-index' for insertion. Mutation changeset identifier: a5c71e2f-74a1-4536-92d2-9ba58d662161 + ✅ Successfully enqueued 5 vectors into index 'my-index' for insertion." + `); }); it("should batch uploads for upsert in ndjson format for Vectorize", async () => { @@ -217,10 +223,13 @@ describe("dataset upsert", () => { expect(insertRequestCount).toBe(2); expect(std.out).toMatchInlineSnapshot(` - "✨ Enqueued 3 vectors into index 'my-index' for upsertion. Mutation changeset identifier: ${mutationId} - ✨ Enqueued 2 vectors into index 'my-index' for upsertion. Mutation changeset identifier: ${mutationId} - ✅ Successfully enqueued 5 vectors into index 'my-index' for upsertion." - `); + " + ⛅️ wrangler x.x.x + ────────────────── + ✨ Enqueued 3 vectors into index 'my-index' for upsertion. Mutation changeset identifier: 2589f9c4-6e77-4931-9868-ef2436ecea92 + ✨ Enqueued 2 vectors into index 'my-index' for upsertion. Mutation changeset identifier: 2589f9c4-6e77-4931-9868-ef2436ecea92 + ✅ Successfully enqueued 5 vectors into index 'my-index' for upsertion." + `); }); it("should reject an invalid file param", async () => { diff --git a/packages/wrangler/src/__tests__/versions/secrets/bulk.test.ts b/packages/wrangler/src/__tests__/versions/secrets/bulk.test.ts index 6f9212edd6..f0a67f294f 100644 --- a/packages/wrangler/src/__tests__/versions/secrets/bulk.test.ts +++ b/packages/wrangler/src/__tests__/versions/secrets/bulk.test.ts @@ -25,7 +25,12 @@ describe("versions secret bulk", () => { ); await runWrangler(`versions secret bulk --name script-name`); expect(std.out).toMatchInlineSnapshot( - `"🌀 Creating the secrets for the Worker \\"script-name\\" "` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secrets for the Worker \\"script-name\\" " + ` ); expect(std.err).toMatchInlineSnapshot(` "X [ERROR] No content found in file or piped input. @@ -64,7 +69,10 @@ describe("versions secret bulk", () => { await runWrangler(`versions secret bulk secrets.json --name script-name`); expect(std.out).toMatchInlineSnapshot( ` - "🌀 Creating the secrets for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secrets for the Worker \\"script-name\\" ✨ Successfully created secret for key: SECRET_1 ✨ Successfully created secret for key: SECRET_2 ✨ Successfully created secret for key: SECRET_3 @@ -85,7 +93,10 @@ describe("versions secret bulk", () => { await runWrangler(`versions secret bulk .env --name script-name`); expect(std.out).toMatchInlineSnapshot( ` - "🌀 Creating the secrets for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secrets for the Worker \\"script-name\\" ✨ Successfully created secret for key: SECRET_1 ✨ Successfully created secret for key: SECRET_2 ✨ Successfully created secret for key: SECRET_3 @@ -135,7 +146,10 @@ describe("versions secret bulk", () => { await runWrangler(`versions secret bulk --name script-name`); expect(std.out).toMatchInlineSnapshot( ` - "🌀 Creating the secrets for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secrets for the Worker \\"script-name\\" ✨ Successfully created secret for key: SECRET_1 ✨ Successfully created secret for key: SECRET_2 ✨ Successfully created secret for key: SECRET_3 @@ -180,7 +194,12 @@ describe("versions secret bulk", () => { await runWrangler(`versions secret bulk --name script-name`); expect(std.out).toMatchInlineSnapshot( - `"🌀 Creating the secrets for the Worker \\"script-name\\" "` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secrets for the Worker \\"script-name\\" " + ` ); expect(std.err).toMatchInlineSnapshot(` "X [ERROR] No content found in file or piped input. @@ -224,7 +243,10 @@ describe("versions secret bulk", () => { await runWrangler(`versions secret bulk secrets.json --name script-name`); expect(std.out).toMatchInlineSnapshot( ` - "🌀 Creating the secrets for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secrets for the Worker \\"script-name\\" ✨ Successfully created secret for key: SECRET_1 ✨ Successfully created secret for key: SECRET_2 ✨ Successfully created secret for key: SECRET_3 @@ -269,7 +291,10 @@ describe("versions secret bulk", () => { await runWrangler(`versions secret bulk secrets.json --name script-name`); expect(std.out).toMatchInlineSnapshot( ` - "🌀 Creating the secrets for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secrets for the Worker \\"script-name\\" ✨ Successfully created secret for key: SECRET_1 ✨ Successfully created secret for key: SECRET_2 ✨ Successfully created secret for key: SECRET_3 diff --git a/packages/wrangler/src/__tests__/versions/secrets/delete.test.ts b/packages/wrangler/src/__tests__/versions/secrets/delete.test.ts index 8b9dc51e6a..144e253ac1 100644 --- a/packages/wrangler/src/__tests__/versions/secrets/delete.test.ts +++ b/packages/wrangler/src/__tests__/versions/secrets/delete.test.ts @@ -42,7 +42,10 @@ describe("versions secret delete", () => { await runWrangler("versions secret delete SECRET --name script-name"); expect(std.out).toMatchInlineSnapshot(` - "🌀 Deleting the secret SECRET on the Worker script-name + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Deleting the secret SECRET on the Worker script-name ✨ Success! Created version id with deleted secret SECRET. ➡️ To deploy this version without the secret SECRET to production traffic use the command \\"wrangler versions deploy\\"." `); @@ -67,7 +70,10 @@ describe("versions secret delete", () => { await runWrangler("versions secret delete SECRET --name script-name"); expect(std.out).toMatchInlineSnapshot(` - "? Are you sure you want to permanently delete the secret SECRET on the Worker script-name? + " + ⛅️ wrangler x.x.x + ────────────────── + ? Are you sure you want to permanently delete the secret SECRET on the Worker script-name? 🤖 Using fallback value in non-interactive context: yes 🌀 Deleting the secret SECRET on the Worker script-name ✨ Success! Created version id with deleted secret SECRET. @@ -95,7 +101,10 @@ describe("versions secret delete", () => { await runWrangler("versions secret delete SECRET"); expect(std.out).toMatchInlineSnapshot(` - "? Are you sure you want to permanently delete the secret SECRET on the Worker script-name? + " + ⛅️ wrangler x.x.x + ────────────────── + ? Are you sure you want to permanently delete the secret SECRET on the Worker script-name? 🤖 Using fallback value in non-interactive context: yes 🌀 Deleting the secret SECRET on the Worker script-name ✨ Success! Created version id with deleted secret SECRET. diff --git a/packages/wrangler/src/__tests__/versions/secrets/list.test.ts b/packages/wrangler/src/__tests__/versions/secrets/list.test.ts index dea533321d..93b252e161 100644 --- a/packages/wrangler/src/__tests__/versions/secrets/list.test.ts +++ b/packages/wrangler/src/__tests__/versions/secrets/list.test.ts @@ -104,7 +104,10 @@ describe("versions secret list", () => { await runWrangler("versions secret list --name script-name"); expect(std.out).toMatchInlineSnapshot(` - "-- Version version-id-1 (100%) secrets -- + " + ⛅️ wrangler x.x.x + ────────────────── + -- Version version-id-1 (100%) secrets -- Secret Name: SECRET_1 Secret Name: SECRET_2 Secret Name: SECRET_3 @@ -121,7 +124,10 @@ describe("versions secret list", () => { await runWrangler("versions secret list --name script-name"); expect(std.out).toMatchInlineSnapshot(` - "-- Version version-id-1 (50%) secrets -- + " + ⛅️ wrangler x.x.x + ────────────────── + -- Version version-id-1 (50%) secrets -- Secret Name: SECRET_1 Secret Name: SECRET_2 Secret Name: SECRET_3 @@ -144,7 +150,10 @@ describe("versions secret list", () => { await runWrangler("versions secret list"); expect(std.out).toMatchInlineSnapshot(` - "-- Version version-id-1 (100%) secrets -- + " + ⛅️ wrangler x.x.x + ────────────────── + -- Version version-id-1 (100%) secrets -- Secret Name: SECRET_1 Secret Name: SECRET_2 Secret Name: SECRET_3 @@ -248,7 +257,10 @@ describe("versions secret list", () => { await runWrangler("versions secret list --latest-version"); expect(std.out).toMatchInlineSnapshot(` - "-- Version version-id-3 (0%) secrets -- + " + ⛅️ wrangler x.x.x + ────────────────── + -- Version version-id-3 (0%) secrets -- Secret Name: SECRET_1 Secret Name: SECRET_1 Secret Name: SECRET_1 diff --git a/packages/wrangler/src/__tests__/versions/secrets/put.test.ts b/packages/wrangler/src/__tests__/versions/secrets/put.test.ts index 8c3f686ea6..7ea6ff8d4e 100644 --- a/packages/wrangler/src/__tests__/versions/secrets/put.test.ts +++ b/packages/wrangler/src/__tests__/versions/secrets/put.test.ts @@ -47,7 +47,10 @@ describe("versions secret put", () => { await runWrangler("versions secret put NEW_SECRET --name script-name"); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Worker \\"script-name\\" ✨ Success! Created version id with secret NEW_SECRET. ➡️ To deploy this version with secret NEW_SECRET to production traffic use the command \\"wrangler versions deploy\\"." `); @@ -75,7 +78,10 @@ describe("versions secret put", () => { await runWrangler("versions secret put NEW_SECRET --name script-name"); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Worker \\"script-name\\" ✨ Success! Created version id with secret NEW_SECRET. ➡️ To deploy this version with secret NEW_SECRET to production traffic use the command \\"wrangler versions deploy\\"." `); @@ -110,7 +116,10 @@ describe("versions secret put", () => { await runWrangler("versions secret put NEW_SECRET --name script-name"); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Worker \\"script-name\\" ✨ Success! Created version id with secret NEW_SECRET. ➡️ To deploy this version with secret NEW_SECRET to production traffic use the command \\"wrangler versions deploy\\"." `); @@ -159,7 +168,10 @@ describe("versions secret put", () => { await runWrangler("versions secret put NEW_SECRET --name script-name"); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Worker \\"script-name\\" ✨ Success! Created version id with secret NEW_SECRET. ➡️ To deploy this version with secret NEW_SECRET to production traffic use the command \\"wrangler versions deploy\\"." `); @@ -193,7 +205,10 @@ describe("versions secret put", () => { await runWrangler("versions secret put NEW_SECRET"); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Worker \\"script-name\\" ✨ Success! Created version id with secret NEW_SECRET. ➡️ To deploy this version with secret NEW_SECRET to production traffic use the command \\"wrangler versions deploy\\"." `); @@ -231,7 +246,10 @@ describe("versions secret put", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Worker \\"script-name\\" ✨ Success! Created version id with secret NEW_SECRET. ➡️ To deploy this version with secret NEW_SECRET to production traffic use the command \\"wrangler versions deploy\\"." `); @@ -272,7 +290,10 @@ describe("versions secret put", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Worker \\"script-name\\" ✨ Success! Created version id with secret NEW_SECRET. ➡️ To deploy this version with secret NEW_SECRET to production traffic use the command \\"wrangler versions deploy\\"." `); @@ -304,7 +325,10 @@ describe("versions secret put", () => { await runWrangler("versions secret put SECRET --name script-name"); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Worker \\"script-name\\" ✨ Success! Created version id with secret SECRET. ➡️ To deploy this version with secret SECRET to production traffic use the command \\"wrangler versions deploy\\"." `); @@ -342,7 +366,10 @@ describe("versions secret put", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Worker \\"script-name\\" ✨ Success! Created version id with secret SECRET. ➡️ To deploy this version with secret SECRET to production traffic use the command \\"wrangler versions deploy\\"." `); @@ -418,7 +445,10 @@ describe("versions secret put", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🌀 Creating the secret for the Worker \\"script-name\\" + " + ⛅️ wrangler x.x.x + ────────────────── + 🌀 Creating the secret for the Worker \\"script-name\\" ✨ Success! Created version id with secret SECRET. ➡️ To deploy this version with secret SECRET to production traffic use the command \\"wrangler versions deploy\\"." `); diff --git a/packages/wrangler/src/__tests__/versions/versions.list.test.ts b/packages/wrangler/src/__tests__/versions/versions.list.test.ts index 056d966156..85d0b54970 100644 --- a/packages/wrangler/src/__tests__/versions/versions.list.test.ts +++ b/packages/wrangler/src/__tests__/versions/versions.list.test.ts @@ -7,8 +7,6 @@ import { runInTempDir } from "../helpers/run-in-tmp"; import { runWrangler } from "../helpers/run-wrangler"; import { writeWranglerConfig } from "../helpers/write-wrangler-config"; -vi.unmock("../../wrangler-banner"); - describe("versions list", () => { mockAccountId(); mockApiToken(); diff --git a/packages/wrangler/src/__tests__/versions/versions.upload.test.ts b/packages/wrangler/src/__tests__/versions/versions.upload.test.ts index 21b96a6d32..aa09abc1d2 100644 --- a/packages/wrangler/src/__tests__/versions/versions.upload.test.ts +++ b/packages/wrangler/src/__tests__/versions/versions.upload.test.ts @@ -139,7 +139,10 @@ describe("versions upload", () => { await expect(result).resolves.toBeUndefined(); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 500 ms Your Worker has access to the following bindings: Binding Resource @@ -170,7 +173,10 @@ describe("versions upload", () => { await expect(result).resolves.toBeUndefined(); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 500 ms Uploaded test-name (TIMINGS) Worker Version ID: 51e4886e-2db7-4900-8d38-fbfecfeab993" @@ -199,7 +205,10 @@ describe("versions upload", () => { await expect(result).resolves.toBeUndefined(); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 500 ms Your Worker has access to the following bindings: Binding Resource @@ -225,7 +234,10 @@ describe("versions upload", () => { await runWrangler("versions upload --preview-alias abcd1234"); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 500 ms Uploaded test-name (TIMINGS) Worker Version ID: 51e4886e-2db7-4900-8d38-fbfecfeab993 @@ -255,7 +267,10 @@ describe("versions upload", () => { await expect(result).resolves.toBeUndefined(); expect(std.out).toMatchInlineSnapshot(` - "Total Upload: xx KiB / gzip: xx KiB + " + ⛅️ wrangler x.x.x + ────────────────── + Total Upload: xx KiB / gzip: xx KiB Worker Startup Time: 500 ms Your Worker has access to the following bindings: Binding Resource @@ -292,7 +307,10 @@ describe("versions upload", () => { }); expect(std.out).toMatchInlineSnapshot(` - "┌─┬─┬─┐ + " + ⛅️ wrangler x.x.x + ────────────────── + ┌─┬─┬─┐ │ Name │ Type │ Size │ ├─┼─┼─┤ │ another.py │ python │ xx KiB │ diff --git a/packages/wrangler/src/__tests__/versions/versions.view.test.ts b/packages/wrangler/src/__tests__/versions/versions.view.test.ts index 5036d4f765..015cc11ad0 100644 --- a/packages/wrangler/src/__tests__/versions/versions.view.test.ts +++ b/packages/wrangler/src/__tests__/versions/versions.view.test.ts @@ -7,8 +7,6 @@ import { runInTempDir } from "../helpers/run-in-tmp"; import { runWrangler } from "../helpers/run-wrangler"; import { writeWranglerConfig } from "../helpers/write-wrangler-config"; -vi.unmock("../../wrangler-banner"); - describe("versions view", () => { mockAccountId(); mockApiToken(); diff --git a/packages/wrangler/src/__tests__/vitest.setup.ts b/packages/wrangler/src/__tests__/vitest.setup.ts index 8bd233791f..6b857f4004 100644 --- a/packages/wrangler/src/__tests__/vitest.setup.ts +++ b/packages/wrangler/src/__tests__/vitest.setup.ts @@ -87,7 +87,6 @@ vi.mock("undici", async (importOriginal) => { vi.mock("../package-manager"); vi.mock("../update-check"); -vi.mock("../wrangler-banner"); beforeAll(() => { msw.listen({ diff --git a/packages/wrangler/src/__tests__/vpc.test.ts b/packages/wrangler/src/__tests__/vpc.test.ts index 494e34d498..e04124d79b 100644 --- a/packages/wrangler/src/__tests__/vpc.test.ts +++ b/packages/wrangler/src/__tests__/vpc.test.ts @@ -109,7 +109,10 @@ describe("vpc service commands", () => { `); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating VPC service 'test-http-ipv4' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating VPC service 'test-http-ipv4' ✅ Created VPC service: service-uuid Name: test-http-ipv4 Type: http @@ -161,7 +164,10 @@ describe("vpc service commands", () => { await runWrangler("vpc service list"); expect(std.out).toMatchInlineSnapshot(` - "📋 Listing VPC services + " + ⛅️ wrangler x.x.x + ────────────────── + 📋 Listing VPC services ┌─┬─┬─┬─┬─┬─┬─┬─┐ │ id │ name │ type │ ports │ host │ tunnel │ created │ modified │ ├─┼─┼─┼─┼─┼─┼─┼─┤ @@ -175,7 +181,10 @@ describe("vpc service commands", () => { await runWrangler("vpc service get service-uuid"); expect(std.out).toMatchInlineSnapshot(` - "🔍 Getting VPC service 'service-uuid' + " + ⛅️ wrangler x.x.x + ────────────────── + 🔍 Getting VPC service 'service-uuid' ✅ Retrieved VPC service: service-uuid Name: test-web-service Type: http @@ -194,7 +203,10 @@ describe("vpc service commands", () => { await runWrangler("vpc service delete service-uuid"); expect(std.out).toMatchInlineSnapshot(` - "🗑️ Deleting VPC service 'service-uuid' + " + ⛅️ wrangler x.x.x + ────────────────── + 🗑️ Deleting VPC service 'service-uuid' ✅ Deleted VPC service: service-uuid" `); }); @@ -247,7 +259,10 @@ describe("vpc service commands", () => { await runWrangler("vpc service get service-uuid"); expect(std.out).toMatchInlineSnapshot(` - "🔍 Getting VPC service 'service-uuid' + " + ⛅️ wrangler x.x.x + ────────────────── + 🔍 Getting VPC service 'service-uuid' ✅ Retrieved VPC service: service-uuid Name: test-web-service Type: http @@ -293,7 +308,10 @@ describe("vpc service commands", () => { ); expect(std.out).toMatchInlineSnapshot(` - "🚧 Creating VPC service 'test-no-resolver' + " + ⛅️ wrangler x.x.x + ────────────────── + 🚧 Creating VPC service 'test-no-resolver' ✅ Created VPC service: service-uuid Name: test-no-resolver Type: http diff --git a/packages/wrangler/src/__tests__/whoami.test.ts b/packages/wrangler/src/__tests__/whoami.test.ts index c65705a987..724c0d0a29 100644 --- a/packages/wrangler/src/__tests__/whoami.test.ts +++ b/packages/wrangler/src/__tests__/whoami.test.ts @@ -235,7 +235,10 @@ describe("whoami", () => { ); await runWrangler(`whoami --account "account-2"`); expect(std.out).toMatchInlineSnapshot(` - "Getting User settings... + " + ⛅️ wrangler x.x.x + ────────────────── + Getting User settings... 👋 You are logged in with an OAuth Token, associated with the email user@example.com. ┌─┬─┐ │ Account Name │ Account ID │ @@ -292,7 +295,10 @@ describe("whoami", () => { ); await runWrangler(`whoami --account "account-2"`); expect(std.out).toMatchInlineSnapshot(` - "Getting User settings... + " + ⛅️ wrangler x.x.x + ────────────────── + Getting User settings... 👋 You are logged in with an OAuth Token, associated with the email user@example.com. ┌─┬─┐ │ Account Name │ Account ID │ diff --git a/packages/wrangler/src/__tests__/worker-namespace.test.ts b/packages/wrangler/src/__tests__/worker-namespace.test.ts index 00e2e4e315..e5908c7749 100644 --- a/packages/wrangler/src/__tests__/worker-namespace.test.ts +++ b/packages/wrangler/src/__tests__/worker-namespace.test.ts @@ -109,7 +109,12 @@ describe("dispatch-namespace", () => { await runWrangler(`dispatch-namespace create ${namespaceName}`); expect(std.out).toMatchInlineSnapshot( - `"Created dispatch namespace \\"my-namespace\\" with ID \\"some-namespace-id\\""` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Created dispatch namespace \\"my-namespace\\" with ID \\"some-namespace-id\\"" + ` ); }); }); @@ -161,7 +166,12 @@ describe("dispatch-namespace", () => { await runWrangler(`dispatch-namespace delete ${namespaceName}`); expect(std.out).toMatchInlineSnapshot( - `"Deleted dispatch namespace \\"my-namespace\\""` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Deleted dispatch namespace \\"my-namespace\\"" + ` ); }); }); @@ -222,15 +232,18 @@ describe("dispatch-namespace", () => { await runWrangler(`dispatch-namespace get ${namespaceName}`); expect(std.out).toMatchInlineSnapshot(` - "{ - namespace_id: 'some-namespace-id', - namespace_name: 'namespace-name', - created_on: '2022-06-29T14:30:08.16152Z', - created_by: '1fc1df98cc4420fe00367c3ab68c1639', - modified_on: '2022-06-29T14:30:08.16152Z', - modified_by: '1fc1df98cc4420fe00367c3ab68c1639' - }" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + { + namespace_id: 'some-namespace-id', + namespace_name: 'namespace-name', + created_on: '2022-06-29T14:30:08.16152Z', + created_by: '1fc1df98cc4420fe00367c3ab68c1639', + modified_on: '2022-06-29T14:30:08.16152Z', + modified_by: '1fc1df98cc4420fe00367c3ab68c1639' + }" + `); }); }); @@ -263,17 +276,20 @@ describe("dispatch-namespace", () => { it("should list all namespaces", async () => { await runWrangler("dispatch-namespace list"); expect(std.out).toMatchInlineSnapshot(` - "[ - { - namespace_id: 'some-namespace-id', - namespace_name: 'namespace-name', - created_on: '2022-06-29T14:30:08.16152Z', - created_by: '1fc1df98cc4420fe00367c3ab68c1639', - modified_on: '2022-06-29T14:30:08.16152Z', - modified_by: '1fc1df98cc4420fe00367c3ab68c1639' - } - ]" - `); + " + ⛅️ wrangler x.x.x + ────────────────── + [ + { + namespace_id: 'some-namespace-id', + namespace_name: 'namespace-name', + created_on: '2022-06-29T14:30:08.16152Z', + created_by: '1fc1df98cc4420fe00367c3ab68c1639', + modified_on: '2022-06-29T14:30:08.16152Z', + modified_by: '1fc1df98cc4420fe00367c3ab68c1639' + } + ]" + `); }); }); @@ -337,7 +353,12 @@ describe("dispatch-namespace", () => { ); expect(std.out).toMatchInlineSnapshot( - `"Renamed dispatch namespace \\"my-namespace\\" to \\"new-namespace\\""` + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Renamed dispatch namespace \\"my-namespace\\" to \\"new-namespace\\"" + ` ); expect((printWranglerBanner as Mock).mock.calls.length).toEqual(1); }); diff --git a/packages/wrangler/src/__tests__/workflows.test.ts b/packages/wrangler/src/__tests__/workflows.test.ts index 9216535fe2..d1052a4d56 100644 --- a/packages/wrangler/src/__tests__/workflows.test.ts +++ b/packages/wrangler/src/__tests__/workflows.test.ts @@ -214,7 +214,10 @@ describe("wrangler workflows", () => { expect(std.info).toMatchInlineSnapshot(`"Showing last 2 workflows:"`); expect(std.out).toMatchInlineSnapshot( ` - "┌─┬─┬─┬─┬─┐ + " + ⛅️ wrangler x.x.x + ────────────────── + ┌─┬─┬─┬─┬─┐ │ Name │ Script name │ Class name │ Created │ Modified │ ├─┼─┼─┼─┼─┤ │ wf_1 │ wf_script_1 │ wf_class_1 │ [mock-create-date] │ [mock-modified-date] │ @@ -296,7 +299,10 @@ describe("wrangler workflows", () => { ); expect(std.out).toMatchInlineSnapshot( ` - "┌─┬─┬─┬─┬─┐ + " + ⛅️ wrangler x.x.x + ────────────────── + ┌─┬─┬─┬─┬─┐ │ Id │ Version │ Created │ Modified │ Status │ ├─┼─┼─┼─┼─┤ │ a │ c │ [mock-create-date] │ [mock-modified-date] │ ✅ Completed │ @@ -405,7 +411,10 @@ describe("wrangler workflows", () => { await runWrangler(`workflows instances describe some-workflow bar`); expect(std.out).toMatchInlineSnapshot(` - " Name: event + " + ⛅️ wrangler x.x.x + ────────────────── + Name: event Type: 👀 Waiting for event Start: [mock-start-date] End: [mock-end-date] @@ -432,7 +441,10 @@ describe("wrangler workflows", () => { await runWrangler(`workflows instances describe some-workflow`); expect(std.out).toMatchInlineSnapshot(` - " Name: event + " + ⛅️ wrangler x.x.x + ────────────────── + Name: event Type: 👀 Waiting for event Start: [mock-start-date] End: [mock-end-date] @@ -662,7 +674,10 @@ describe("wrangler workflows", () => { await runWrangler(`workflows delete some-workflow`); expect(std.out).toMatchInlineSnapshot( ` - "✅ Workflow \\"some-workflow\\" removed successfully. + " + ⛅️ wrangler x.x.x + ────────────────── + ✅ Workflow \\"some-workflow\\" removed successfully. Note that running instances might take a few minutes to be properly terminated." ` ); From 992506c289e3af2c7585bc0944b1a1089a22abb4 Mon Sep 17 00:00:00 2001 From: Edmund Hung Date: Fri, 3 Oct 2025 16:02:33 +0100 Subject: [PATCH 2/5] fix: weird snapshot setup in vectorize tests --- .../src/__tests__/vectorize/vectorize.test.ts | 45 ++----------------- 1 file changed, 4 insertions(+), 41 deletions(-) diff --git a/packages/wrangler/src/__tests__/vectorize/vectorize.test.ts b/packages/wrangler/src/__tests__/vectorize/vectorize.test.ts index 382c94d121..d1ebf6394e 100644 --- a/packages/wrangler/src/__tests__/vectorize/vectorize.test.ts +++ b/packages/wrangler/src/__tests__/vectorize/vectorize.test.ts @@ -533,7 +533,7 @@ describe("vectorize commands", () => { await runWrangler( "vectorize query test-index --vector 1 2 3 '4' 1.5 '2.6' a 'b' null 7 abc 8 undefined" ); - expect(std.out).toMatchInlineSnapshot(querySnapshot` + expect(std.out).toMatchInlineSnapshot(` " ⛅️ wrangler x.x.x ────────────────── @@ -578,7 +578,7 @@ describe("vectorize commands", () => { it("should handle a query with a vector-id", async () => { mockVectorizeV2Request(); await runWrangler("vectorize query test-index --vector-id some-vector-id"); - expect(std.out).toMatchInlineSnapshot(querySnapshot` + expect(std.out).toMatchInlineSnapshot(` " ⛅️ wrangler x.x.x ────────────────── @@ -629,7 +629,7 @@ describe("vectorize commands", () => { await runWrangler( `vectorize query test-index --vector 1 2 3 '4' --top-k=2 --return-values=true --return-metadata=indexed --namespace=abc --filter '{ "p1": "abc", "p2": { "$ne": true }, "p3": 10, "p4": false, "nested.p5": "abcd" }'` ); - expect(std.out).toMatchInlineSnapshot(querySnapshot` + expect(std.out).toMatchInlineSnapshot(` " ⛅️ wrangler x.x.x ────────────────── @@ -679,7 +679,7 @@ describe("vectorize commands", () => { await runWrangler( "vectorize query test-index --vector 1 2 3 '4' --filter='{ 'p1': [1,2,3] }'" ); - expect(std.out).toMatchInlineSnapshot(querySnapshot` + expect(std.out).toMatchInlineSnapshot(` " ⛅️ wrangler x.x.x ────────────────── @@ -1123,43 +1123,6 @@ describe("vectorize query filter", () => { }); }); -const querySnapshot = ` - "📋 Searching for relevant vectors... -{ - \\"count\\": 2, - \\"matches\\": [ - { - \\"id\\": \\"a\\", - \\"score\\": 0.5, - \\"values\\": [ - 1, - 2, - 3, - 4 - ], - \\"namespace\\": \\"abcd\\", - \\"metadata\\": { - \\"a\\": true, - \\"b\\": 123 - } - }, - { - \\"id\\": \\"b\\", - \\"score\\": 0.75, - \\"values\\": [ - 5, - 6, - 7, - 8 - ], - \\"metadata\\": { - \\"c\\": false, - \\"b\\": \\"123\\" - } - } - ] -}"`; - /** Create a mock handler for the Vectorize API */ function mockVectorizeRequest() { msw.use( From 455bb52ee16294fb38db7927820fcf810bdaef29 Mon Sep 17 00:00:00 2001 From: Edmund Hung Date: Fri, 3 Oct 2025 16:27:04 +0100 Subject: [PATCH 3/5] make sure cert & mtls-cert tests use toMatchInlineSnapshot --- packages/wrangler/src/__tests__/cert.test.ts | 97 ++++++++++++------- .../src/__tests__/mtls-certificates.test.ts | 63 +++++++----- 2 files changed, 100 insertions(+), 60 deletions(-) diff --git a/packages/wrangler/src/__tests__/cert.test.ts b/packages/wrangler/src/__tests__/cert.test.ts index 314220c976..c8de92875e 100644 --- a/packages/wrangler/src/__tests__/cert.test.ts +++ b/packages/wrangler/src/__tests__/cert.test.ts @@ -506,12 +506,17 @@ describe("wrangler", () => { ); expect(std.err).toMatchInlineSnapshot(`""`); - expect(std.out).toEqual( - `Uploading mTLS Certificate... -Success! Uploaded mTLS Certificate -ID: 1234 -Issuer: example.com... -Expires on ${oneYearLater.toLocaleDateString()}` + expect(std.out).toMatchInlineSnapshot( + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Uploading mTLS Certificate... + Success! Uploaded mTLS Certificate + ID: 1234 + Issuer: example.com... + Expires on 10/3/2026" + ` ); }); @@ -526,12 +531,17 @@ Expires on ${oneYearLater.toLocaleDateString()}` ); expect(std.err).toMatchInlineSnapshot(`""`); - expect(std.out).toEqual( - `Uploading mTLS Certificate my-cert... -Success! Uploaded mTLS Certificate my-cert -ID: 1234 -Issuer: example.com... -Expires on ${oneYearLater.toLocaleDateString()}` + expect(std.out).toMatchInlineSnapshot( + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Uploading mTLS Certificate my-cert... + Success! Uploaded mTLS Certificate my-cert + ID: 1234 + Issuer: example.com... + Expires on 10/3/2026" + ` ); }); @@ -545,12 +555,17 @@ Expires on ${oneYearLater.toLocaleDateString()}` ); expect(std.err).toMatchInlineSnapshot(`""`); - expect(std.out).toEqual( - `Uploading CA Certificate... -Success! Uploaded CA Certificate -ID: 1234 -Issuer: example.com... -Expires on ${oneYearLater.toLocaleDateString()}` + expect(std.out).toMatchInlineSnapshot( + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Uploading CA Certificate... + Success! Uploaded CA Certificate + ID: 1234 + Issuer: example.com... + Expires on 10/3/2026" + ` ); }); @@ -564,12 +579,17 @@ Expires on ${oneYearLater.toLocaleDateString()}` ); expect(std.err).toMatchInlineSnapshot(`""`); - expect(std.out).toEqual( - `Uploading CA Certificate my-caCert... -Success! Uploaded CA Certificate my-caCert -ID: 1234 -Issuer: example.com... -Expires on ${oneYearLater.toLocaleDateString()}` + expect(std.out).toMatchInlineSnapshot( + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Uploading CA Certificate my-caCert... + Success! Uploaded CA Certificate my-caCert + ID: 1234 + Issuer: example.com... + Expires on 10/3/2026" + ` ); }); }); @@ -581,21 +601,26 @@ Expires on ${oneYearLater.toLocaleDateString()}` await runWrangler("cert list"); expect(std.err).toMatchInlineSnapshot(`""`); - expect(std.out).toEqual( - `ID: 1234 -Name: cert one -Issuer: example.com... -Created on: ${now.toLocaleDateString()} -Expires on: ${oneYearLater.toLocaleDateString()} + expect(std.out).toMatchInlineSnapshot( + ` + " + ⛅️ wrangler x.x.x + ────────────────── + ID: 1234 + Name: cert one + Issuer: example.com... + Created on: 10/3/2025 + Expires on: 10/3/2026 -ID: 5678 -Name: cert two -Issuer: example.com... -Created on: ${now.toLocaleDateString()} -Expires on: ${oneYearLater.toLocaleDateString()} + ID: 5678 + Name: cert two + Issuer: example.com... + Created on: 10/3/2025 + Expires on: 10/3/2026 -` + " + ` ); }); }); diff --git a/packages/wrangler/src/__tests__/mtls-certificates.test.ts b/packages/wrangler/src/__tests__/mtls-certificates.test.ts index c37bcd84be..9b8994beef 100644 --- a/packages/wrangler/src/__tests__/mtls-certificates.test.ts +++ b/packages/wrangler/src/__tests__/mtls-certificates.test.ts @@ -424,12 +424,17 @@ describe("wrangler", () => { ); expect(std.err).toMatchInlineSnapshot(`""`); - expect(std.out).toEqual( - `Uploading mTLS Certificate... -Success! Uploaded mTLS Certificate -ID: 1234 -Issuer: example.com... -Expires on ${oneYearLater.toLocaleDateString()}` + expect(std.out).toMatchInlineSnapshot( + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Uploading mTLS Certificate... + Success! Uploaded mTLS Certificate + ID: 1234 + Issuer: example.com... + Expires on 10/3/2026" + ` ); }); @@ -444,12 +449,17 @@ Expires on ${oneYearLater.toLocaleDateString()}` ); expect(std.err).toMatchInlineSnapshot(`""`); - expect(std.out).toEqual( - `Uploading mTLS Certificate my-cert... -Success! Uploaded mTLS Certificate my-cert -ID: 1234 -Issuer: example.com... -Expires on ${oneYearLater.toLocaleDateString()}` + expect(std.out).toMatchInlineSnapshot( + ` + " + ⛅️ wrangler x.x.x + ────────────────── + Uploading mTLS Certificate my-cert... + Success! Uploaded mTLS Certificate my-cert + ID: 1234 + Issuer: example.com... + Expires on 10/3/2026" + ` ); }); }); @@ -461,21 +471,26 @@ Expires on ${oneYearLater.toLocaleDateString()}` await runWrangler("mtls-certificate list"); expect(std.err).toMatchInlineSnapshot(`""`); - expect(std.out).toEqual( - `ID: 1234 -Name: cert one -Issuer: example.com... -Created on: ${now.toLocaleDateString()} -Expires on: ${oneYearLater.toLocaleDateString()} + expect(std.out).toMatchInlineSnapshot( + ` + " + ⛅️ wrangler x.x.x + ────────────────── + ID: 1234 + Name: cert one + Issuer: example.com... + Created on: 10/3/2025 + Expires on: 10/3/2026 -ID: 5678 -Name: cert two -Issuer: example.com... -Created on: ${now.toLocaleDateString()} -Expires on: ${oneYearLater.toLocaleDateString()} + ID: 5678 + Name: cert two + Issuer: example.com... + Created on: 10/3/2025 + Expires on: 10/3/2026 -` + " + ` ); }); }); From d5dc0ae8ecd46031c92923836f20acdd617ff002 Mon Sep 17 00:00:00 2001 From: Edmund Hung Date: Fri, 3 Oct 2025 16:31:08 +0100 Subject: [PATCH 4/5] mock wrangler banner in worker namespace tests explicitly --- .../src/__tests__/worker-namespace.test.ts | 33 ++++--------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/packages/wrangler/src/__tests__/worker-namespace.test.ts b/packages/wrangler/src/__tests__/worker-namespace.test.ts index e5908c7749..044c20401a 100644 --- a/packages/wrangler/src/__tests__/worker-namespace.test.ts +++ b/packages/wrangler/src/__tests__/worker-namespace.test.ts @@ -11,6 +11,8 @@ import { runInTempDir } from "./helpers/run-in-tmp"; import { runWrangler } from "./helpers/run-wrangler"; import type { Mock } from "vitest"; +vi.mock("../wrangler-banner"); + describe("dispatch-namespace", () => { const std = mockConsoleMethods(); beforeEach(() => msw.use(...mswSuccessNamespacesHandlers)); @@ -109,12 +111,7 @@ describe("dispatch-namespace", () => { await runWrangler(`dispatch-namespace create ${namespaceName}`); expect(std.out).toMatchInlineSnapshot( - ` - " - ⛅️ wrangler x.x.x - ────────────────── - Created dispatch namespace \\"my-namespace\\" with ID \\"some-namespace-id\\"" - ` + `"Created dispatch namespace \\"my-namespace\\" with ID \\"some-namespace-id\\""` ); }); }); @@ -166,12 +163,7 @@ describe("dispatch-namespace", () => { await runWrangler(`dispatch-namespace delete ${namespaceName}`); expect(std.out).toMatchInlineSnapshot( - ` - " - ⛅️ wrangler x.x.x - ────────────────── - Deleted dispatch namespace \\"my-namespace\\"" - ` + `"Deleted dispatch namespace \\"my-namespace\\""` ); }); }); @@ -232,10 +224,7 @@ describe("dispatch-namespace", () => { await runWrangler(`dispatch-namespace get ${namespaceName}`); expect(std.out).toMatchInlineSnapshot(` - " - ⛅️ wrangler x.x.x - ────────────────── - { + "{ namespace_id: 'some-namespace-id', namespace_name: 'namespace-name', created_on: '2022-06-29T14:30:08.16152Z', @@ -276,10 +265,7 @@ describe("dispatch-namespace", () => { it("should list all namespaces", async () => { await runWrangler("dispatch-namespace list"); expect(std.out).toMatchInlineSnapshot(` - " - ⛅️ wrangler x.x.x - ────────────────── - [ + "[ { namespace_id: 'some-namespace-id', namespace_name: 'namespace-name', @@ -353,12 +339,7 @@ describe("dispatch-namespace", () => { ); expect(std.out).toMatchInlineSnapshot( - ` - " - ⛅️ wrangler x.x.x - ────────────────── - Renamed dispatch namespace \\"my-namespace\\" to \\"new-namespace\\"" - ` + `"Renamed dispatch namespace \\"my-namespace\\" to \\"new-namespace\\""` ); expect((printWranglerBanner as Mock).mock.calls.length).toEqual(1); }); From b5897ba9465711bbca8779b8a2348cdb8d1a0e14 Mon Sep 17 00:00:00 2001 From: Edmund Hung Date: Fri, 3 Oct 2025 16:46:00 +0100 Subject: [PATCH 5/5] normalize uuid in vectorize tests --- .../__tests__/vectorize/vectorize.upsert.test.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/wrangler/src/__tests__/vectorize/vectorize.upsert.test.ts b/packages/wrangler/src/__tests__/vectorize/vectorize.upsert.test.ts index 2e4e63b89c..d7303186e8 100644 --- a/packages/wrangler/src/__tests__/vectorize/vectorize.upsert.test.ts +++ b/packages/wrangler/src/__tests__/vectorize/vectorize.upsert.test.ts @@ -161,12 +161,14 @@ describe("dataset upsert", () => { ); expect(insertRequestCount).toBe(2); - expect(std.out).toMatchInlineSnapshot(` + expect( + std.out.replaceAll(mutationId, "00000000-0000-0000-0000-000000000000") + ).toMatchInlineSnapshot(` " ⛅️ wrangler x.x.x ────────────────── - ✨ Enqueued 3 vectors into index 'my-index' for insertion. Mutation changeset identifier: a5c71e2f-74a1-4536-92d2-9ba58d662161 - ✨ Enqueued 2 vectors into index 'my-index' for insertion. Mutation changeset identifier: a5c71e2f-74a1-4536-92d2-9ba58d662161 + ✨ Enqueued 3 vectors into index 'my-index' for insertion. Mutation changeset identifier: 00000000-0000-0000-0000-000000000000 + ✨ Enqueued 2 vectors into index 'my-index' for insertion. Mutation changeset identifier: 00000000-0000-0000-0000-000000000000 ✅ Successfully enqueued 5 vectors into index 'my-index' for insertion." `); }); @@ -222,12 +224,14 @@ describe("dataset upsert", () => { ); expect(insertRequestCount).toBe(2); - expect(std.out).toMatchInlineSnapshot(` + expect( + std.out.replaceAll(mutationId, "00000000-0000-0000-0000-000000000000") + ).toMatchInlineSnapshot(` " ⛅️ wrangler x.x.x ────────────────── - ✨ Enqueued 3 vectors into index 'my-index' for upsertion. Mutation changeset identifier: 2589f9c4-6e77-4931-9868-ef2436ecea92 - ✨ Enqueued 2 vectors into index 'my-index' for upsertion. Mutation changeset identifier: 2589f9c4-6e77-4931-9868-ef2436ecea92 + ✨ Enqueued 3 vectors into index 'my-index' for upsertion. Mutation changeset identifier: 00000000-0000-0000-0000-000000000000 + ✨ Enqueued 2 vectors into index 'my-index' for upsertion. Mutation changeset identifier: 00000000-0000-0000-0000-000000000000 ✅ Successfully enqueued 5 vectors into index 'my-index' for upsertion." `); });