From 0c0c4533a67d6488f4a5c76db65801e447347e97 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Mon, 31 Jan 2022 20:59:12 +0000 Subject: [PATCH] test: handle normalization of test output automatically Adds the `normalizeSlashes()` and `stripTimings()` helpers automatically to output and errors, so that the test author doesn't have to remember to add them. --- .../src/__tests__/helpers/run-wrangler.ts | 8 +- packages/wrangler/src/__tests__/index.test.ts | 68 ++--- packages/wrangler/src/__tests__/kv.test.ts | 252 ++++++------------ .../wrangler/src/__tests__/publish.test.ts | 58 ++-- 4 files changed, 141 insertions(+), 245 deletions(-) diff --git a/packages/wrangler/src/__tests__/helpers/run-wrangler.ts b/packages/wrangler/src/__tests__/helpers/run-wrangler.ts index 002bf46928d25..1fc8dbc73a1ee 100644 --- a/packages/wrangler/src/__tests__/helpers/run-wrangler.ts +++ b/packages/wrangler/src/__tests__/helpers/run-wrangler.ts @@ -1,8 +1,14 @@ import { main } from "../../index"; +import { normalizeSlashes, stripTimings } from "./mock-console"; /** * A helper to 'run' wrangler commands for tests. */ export async function runWrangler(cmd?: string) { - await main(cmd?.split(" ") ?? []); + try { + await main(cmd?.split(" ") ?? []); + } catch (e) { + e.message = normalizeSlashes(stripTimings(e.message)); + throw e; + } } diff --git a/packages/wrangler/src/__tests__/index.test.ts b/packages/wrangler/src/__tests__/index.test.ts index e20ec6ae9f93c..80f229c622733 100644 --- a/packages/wrangler/src/__tests__/index.test.ts +++ b/packages/wrangler/src/__tests__/index.test.ts @@ -52,14 +52,11 @@ describe("wrangler", () => { describe("invalid command", () => { it("should display an error", async () => { - let err: Error | undefined; - try { - await runWrangler("invalid-command"); - } catch (e) { - err = e; - } finally { - expect(err?.message).toBe(`Unknown command: invalid-command.`); - } + await expect( + runWrangler("invalid-command") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Unknown command: invalid-command."` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` @@ -370,50 +367,35 @@ describe("wrangler", () => { }); it("should error if `--type` is used", async () => { - let err: undefined | Error; - try { - await runWrangler("init --type"); - } catch (e) { - err = e; - } finally { - expect(err?.message).toBe(`The --type option is no longer supported.`); - } + await expect( + runWrangler("init --type") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"The --type option is no longer supported."` + ); }); it("should error if `--type javascript` is used", async () => { - let err: undefined | Error; - try { - await runWrangler("init --type javascript"); - } catch (e) { - err = e; - } finally { - expect(err?.message).toBe(`The --type option is no longer supported.`); - } + await expect( + runWrangler("init --type javascript") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"The --type option is no longer supported."` + ); }); it("should error if `--type rust` is used", async () => { - let err: undefined | Error; - try { - await runWrangler("init --type rust"); - } catch (e) { - err = e; - } finally { - expect(err?.message).toBe(`The --type option is no longer supported.`); - } + await expect( + runWrangler("init --type rust") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"The --type option is no longer supported."` + ); }); it("should error if `--type webpack` is used", async () => { - let err: undefined | Error; - try { - await runWrangler("init --type webpack"); - } catch (e) { - err = e; - } finally { - expect(err?.message).toBe( - `The --type option is no longer supported. -If you wish to use webpack then you will need to create a custom build.` - ); - } + await expect(runWrangler("init --type webpack")).rejects + .toThrowErrorMatchingInlineSnapshot(` + "The --type option is no longer supported. + If you wish to use webpack then you will need to create a custom build." + `); }); }); }); diff --git a/packages/wrangler/src/__tests__/kv.test.ts b/packages/wrangler/src/__tests__/kv.test.ts index e296b2a5b41e7..3a7022d3692d9 100644 --- a/packages/wrangler/src/__tests__/kv.test.ts +++ b/packages/wrangler/src/__tests__/kv.test.ts @@ -37,12 +37,11 @@ describe("wrangler", () => { } it("should error if no namespace is given", async () => { - let error: Error | undefined; - try { - await runWrangler("kv:namespace create"); - } catch (e) { - error = e; - } + await expect( + runWrangler("kv:namespace create") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Not enough non-option arguments: got 0, need at least 1"` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` "wrangler kv:namespace create @@ -64,18 +63,14 @@ describe("wrangler", () => { Not enough non-option arguments: got 0, need at least 1" `); - expect(error).toMatchInlineSnapshot( - `[Error: Not enough non-option arguments: got 0, need at least 1]` - ); }); it("should error if the namespace to create contains spaces", async () => { - let error: Error | undefined; - try { - await runWrangler("kv:namespace create abc def ghi"); - } catch (e) { - error = e; - } + await expect( + runWrangler("kv:namespace create abc def ghi") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Unexpected additional positional arguments \\"def ghi\\"."` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` "wrangler kv:namespace create @@ -97,18 +92,14 @@ describe("wrangler", () => { Unexpected additional positional arguments \\"def ghi\\"." `); - expect(error).toMatchInlineSnapshot( - `[Error: Unexpected additional positional arguments "def ghi".]` - ); }); it("should error if the namespace to create is not valid", async () => { - let error: Error | undefined; - try { - await runWrangler("kv:namespace create abc-def"); - } catch (e) { - error = e; - } + await expect( + runWrangler("kv:namespace create abc-def") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"The namespace binding name \\"abc-def\\" is invalid. It can only have alphanumeric and _ characters, and cannot begin with a number."` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` @@ -131,9 +122,6 @@ describe("wrangler", () => { The namespace binding name \\"abc-def\\" is invalid. It can only have alphanumeric and _ characters, and cannot begin with a number." `); - expect(error).toMatchInlineSnapshot( - `[Error: The namespace binding name "abc-def" is invalid. It can only have alphanumeric and _ characters, and cannot begin with a number.]` - ); }); it("should create a namespace", async () => { @@ -276,16 +264,11 @@ describe("wrangler", () => { it("should error if a given binding name is not in the configured kv namespaces", async () => { writeWranglerConfig(); - let error: Error | undefined; - try { - await runWrangler("kv:namespace delete --binding otherBinding"); - } catch (e) { - error = e; - } - expect(error).toMatchInlineSnapshot(` - [Error: Not able to delete namespace. - A namespace with binding name "otherBinding" was not found in the configured "kv_namespaces".] - `); + await expect(runWrangler("kv:namespace delete --binding otherBinding")) + .rejects.toThrowErrorMatchingInlineSnapshot(` + "Not able to delete namespace. + A namespace with binding name \\"otherBinding\\" was not found in the configured \\"kv_namespaces\\"." + `); expect(std.err).toMatchInlineSnapshot(` "wrangler kv:namespace delete @@ -425,21 +408,14 @@ describe("wrangler", () => { 10, 20 ); - let error: Error | undefined; - try { - await runWrangler( - "kv:key put my-key my-value --namespace-id some-namespace-id --expiration 10 --ttl 20" - ); - } catch (e) { - error = e; - } - + await runWrangler( + "kv:key put my-key my-value --namespace-id some-namespace-id --expiration 10 --ttl 20" + ); expect(requests.count).toEqual(1); expect(std.out).toMatchInlineSnapshot( `"writing the value \\"my-value\\" to key \\"my-key\\" on namespace some-namespace-id"` ); expect(std.err).toMatchInlineSnapshot(`""`); - expect(error).toMatchInlineSnapshot(`undefined`); }); it("should put a key to the specified environment in a given namespace", async () => { @@ -477,12 +453,11 @@ describe("wrangler", () => { }); it("should error if no key is provided", async () => { - let error: Error | undefined; - try { - await runWrangler("kv:key put"); - } catch (e) { - error = e; - } + await expect( + runWrangler("kv:key put") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Not enough non-option arguments: got 0, need at least 1"` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` @@ -511,18 +486,14 @@ describe("wrangler", () => { Not enough non-option arguments: got 0, need at least 1" `); - expect(error).toMatchInlineSnapshot( - `[Error: Not enough non-option arguments: got 0, need at least 1]` - ); }); it("should error if no binding nor namespace is provided", async () => { - let error: Error | undefined; - try { - await runWrangler("kv:key put foo bar"); - } catch (e) { - error = e; - } + await expect( + runWrangler("kv:key put foo bar") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Exactly one of the arguments binding and namespace-id is required"` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` @@ -551,18 +522,14 @@ describe("wrangler", () => { Exactly one of the arguments binding and namespace-id is required" `); - expect(error).toMatchInlineSnapshot( - `[Error: Exactly one of the arguments binding and namespace-id is required]` - ); }); it("should error if both binding and namespace is provided", async () => { - let error: Error | undefined; - try { - await runWrangler("kv:key put foo bar --binding x --namespace-id y"); - } catch (e) { - error = e; - } + await expect( + runWrangler("kv:key put foo bar --binding x --namespace-id y") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Arguments binding and namespace-id are mutually exclusive"` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` @@ -591,18 +558,14 @@ describe("wrangler", () => { Arguments binding and namespace-id are mutually exclusive" `); - expect(error).toMatchInlineSnapshot( - `[Error: Arguments binding and namespace-id are mutually exclusive]` - ); }); it("should error if no value nor path is provided", async () => { - let error: Error | undefined; - try { - await runWrangler("kv:key put key --namespace-id 12345"); - } catch (e) { - error = e; - } + await expect( + runWrangler("kv:key put key --namespace-id 12345") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Exactly one of the arguments value and path is required"` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` @@ -631,20 +594,14 @@ describe("wrangler", () => { Exactly one of the arguments value and path is required" `); - expect(error).toMatchInlineSnapshot( - `[Error: Exactly one of the arguments value and path is required]` - ); }); it("should error if both value and path is provided", async () => { - let error: Error | undefined; - try { - await runWrangler( - "kv:key put key value --path xyz --namespace-id 12345" - ); - } catch (e) { - error = e; - } + await expect( + runWrangler("kv:key put key value --path xyz --namespace-id 12345") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Arguments value and path are mutually exclusive"` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` @@ -673,19 +630,15 @@ describe("wrangler", () => { Arguments value and path are mutually exclusive" `); - expect(error).toMatchInlineSnapshot( - `[Error: Arguments value and path are mutually exclusive]` - ); }); it("should error if a given binding name is not in the configured kv namespaces", async () => { writeWranglerConfig(); - let error: Error | undefined; - try { - await runWrangler("kv:key put key value --binding otherBinding"); - } catch (e) { - error = e; - } + await expect( + runWrangler("kv:key put key value --binding otherBinding") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"A namespace with binding name \\"otherBinding\\" was not found in the configured \\"kv_namespaces\\"."` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` @@ -694,9 +647,6 @@ describe("wrangler", () => { %s If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new." `); - expect(error).toMatchInlineSnapshot( - `[Error: A namespace with binding name "otherBinding" was not found in the configured "kv_namespaces".]` - ); }); it("should error if a given binding has both preview and non-preview and --preview is not specified", async () => { @@ -706,12 +656,11 @@ describe("wrangler", () => { "my-key", "my-value" ); - let error: Error | undefined; - try { - await runWrangler("kv:key put my-key my-value --binding someBinding"); - } catch (e) { - error = e; - } + await expect( + runWrangler("kv:key put my-key my-value --binding someBinding") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"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(`""`); expect(std.err).toMatchInlineSnapshot(` "someBinding has both a namespace ID and a preview ID. Specify \\"--preview\\" or \\"--preview false\\" to avoid writing data to the wrong namespace. @@ -719,9 +668,6 @@ describe("wrangler", () => { %s If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new." `); - expect(error).toMatchInlineSnapshot( - `[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(requests.count).toEqual(0); }); }); @@ -900,14 +846,10 @@ describe("wrangler", () => { it("should error if a given binding name is not in the configured kv namespaces", async () => { writeWranglerConfig(); - let error: Error | undefined; - try { - await runWrangler("kv:key list --binding otherBinding"); - } catch (e) { - error = e; - } - expect(error).toMatchInlineSnapshot( - `[Error: A namespace with binding name "otherBinding" was not found in the configured "kv_namespaces".]` + await expect( + runWrangler("kv:key list --binding otherBinding") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"A namespace with binding name \\"otherBinding\\" was not found in the configured \\"kv_namespaces\\"."` ); expect(std.err).toMatchInlineSnapshot(` "A namespace with binding name \\"otherBinding\\" was not found in the configured \\"kv_namespaces\\". @@ -991,12 +933,11 @@ describe("wrangler", () => { }); it("should error if no key is provided", async () => { - let error: Error | undefined; - try { - await runWrangler("kv:key get"); - } catch (e) { - error = e; - } + await expect( + runWrangler("kv:key get") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Not enough non-option arguments: got 0, need at least 1"` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` "wrangler kv:key get @@ -1020,18 +961,14 @@ describe("wrangler", () => { Not enough non-option arguments: got 0, need at least 1" `); - expect(error).toMatchInlineSnapshot( - `[Error: Not enough non-option arguments: got 0, need at least 1]` - ); }); it("should error if no binding nor namespace is provided", async () => { - let error: Error | undefined; - try { - await runWrangler("kv:key get foo"); - } catch (e) { - error = e; - } + await expect( + runWrangler("kv:key get foo") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Exactly one of the arguments binding and namespace-id is required"` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` "wrangler kv:key get @@ -1055,18 +992,14 @@ describe("wrangler", () => { Exactly one of the arguments binding and namespace-id is required" `); - expect(error).toMatchInlineSnapshot( - `[Error: Exactly one of the arguments binding and namespace-id is required]` - ); }); it("should error if both binding and namespace is provided", async () => { - let error: Error | undefined; - try { - await runWrangler("kv:key get foo --binding x --namespace-id y"); - } catch (e) { - error = e; - } + await expect( + runWrangler("kv:key get foo --binding x --namespace-id y") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Arguments binding and namespace-id are mutually exclusive"` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` @@ -1091,19 +1024,15 @@ describe("wrangler", () => { Arguments binding and namespace-id are mutually exclusive" `); - expect(error).toMatchInlineSnapshot( - `[Error: Arguments binding and namespace-id are mutually exclusive]` - ); }); it("should error if a given binding name is not in the configured kv namespaces", async () => { writeWranglerConfig(); - let error: Error | undefined; - try { - await runWrangler("kv:key get key --binding otherBinding"); - } catch (e) { - error = e; - } + await expect( + runWrangler("kv:key get key --binding otherBinding") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"A namespace with binding name \\"otherBinding\\" was not found in the configured \\"kv_namespaces\\"."` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` "A namespace with binding name \\"otherBinding\\" was not found in the configured \\"kv_namespaces\\". @@ -1111,9 +1040,6 @@ describe("wrangler", () => { %s If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new." `); - expect(error).toMatchInlineSnapshot( - `[Error: A namespace with binding name "otherBinding" was not found in the configured "kv_namespaces".]` - ); }); }); @@ -1165,12 +1091,11 @@ describe("wrangler", () => { it("should error if a given binding name is not in the configured kv namespaces", async () => { writeWranglerConfig(); - let error: Error | undefined; - try { - await runWrangler(`kv:key delete --binding otherBinding someKey`); - } catch (e) { - error = e; - } + await expect( + runWrangler(`kv:key delete --binding otherBinding someKey`) + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"A namespace with binding name \\"otherBinding\\" was not found in the configured \\"kv_namespaces\\"."` + ); expect(std.err).toMatchInlineSnapshot(` "A namespace with binding name \\"otherBinding\\" was not found in the configured \\"kv_namespaces\\". @@ -1178,9 +1103,6 @@ describe("wrangler", () => { %s If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new." `); - expect(error).toMatchInlineSnapshot( - `[Error: A namespace with binding name "otherBinding" was not found in the configured "kv_namespaces".]` - ); }); it("should delete a key in a namespace specified by binding name in a given environment", async () => { diff --git a/packages/wrangler/src/__tests__/publish.test.ts b/packages/wrangler/src/__tests__/publish.test.ts index 2a223cdccd873..f5604fcd7a34a 100644 --- a/packages/wrangler/src/__tests__/publish.test.ts +++ b/packages/wrangler/src/__tests__/publish.test.ts @@ -213,12 +213,12 @@ export default{ writeWorkerSource(); mockUploadWorkerRequest(); mockSubDomainRequest(); - let error: Error | undefined; - try { - await runWrangler("publish ./index.js"); - } catch (e) { - error = e; - } + + await expect( + runWrangler("publish ./index.js") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"A [site] definition requires a \`bucket\` field with a path to the site's public directory."` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` @@ -232,9 +232,6 @@ export default{ The entry-point should be specified via the command line (e.g. \`wrangler publish path/to/script\`) or the \`build.upload.main\` config field. Please remove the \`site.entry-point\` field from the \`wrangler.toml\` file." `); - expect(error).toMatchInlineSnapshot( - `[AssertionError: A [site] definition requires a \`bucket\` field with a path to the site's public directory.]` - ); }); it("should warn if there is a `site.entry-point` configuration", async () => { @@ -290,12 +287,11 @@ export default{ writeWorkerSource(); mockUploadWorkerRequest(); mockSubDomainRequest(); - let error: Error | undefined; - try { - await runWrangler("publish"); - } catch (e) { - error = e; - } + await expect( + runWrangler("publish") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Missing entry-point: The entry-point should be specified via the command line (e.g. \`wrangler publish path/to/script\`) or the \`build.upload.main\` config field."` + ); expect(std.out).toMatchInlineSnapshot(`""`); expect(std.err).toMatchInlineSnapshot(` @@ -304,9 +300,6 @@ export default{ %s If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new." `); - expect(error).toMatchInlineSnapshot( - `[Error: Missing entry-point: The entry-point should be specified via the command line (e.g. \`wrangler publish path/to/script\`) or the \`build.upload.main\` config field.]` - ); }); }); @@ -943,12 +936,12 @@ export default{ mockListKVNamespacesRequest(kvNamespace); mockKeyListRequest(kvNamespace.id, []); - let error: Error | undefined; - try { - await runWrangler("publish"); - } catch (e) { - error = e; - } + await expect( + runWrangler("publish") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"File assets/too-large-file.txt is too big, it should be under 25 MiB. See https://developers.cloudflare.com/workers/platform/limits#kv-limits"` + ); + expect(std.out).toMatchInlineSnapshot(` "reading assets/large-file.txt... uploading as assets/large-file.0ea0637a45.txt..." @@ -959,9 +952,6 @@ export default{ %s If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new." `); - expect(`${error}`).toMatchInlineSnapshot( - `"Error: File assets/too-large-file.txt is too big, it should be under 25 MiB. See https://developers.cloudflare.com/workers/platform/limits#kv-limits"` - ); }); it("should error if the asset key is over 512 characters", async () => { @@ -986,12 +976,11 @@ export default{ mockListKVNamespacesRequest(kvNamespace); mockKeyListRequest(kvNamespace.id, []); - let error: Error | undefined; - try { - await runWrangler("publish"); - } catch (e) { - error = e; - } + await expect( + runWrangler("publish") + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"The asset path key \\"assets/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\\","` + ); expect(std.out).toMatchInlineSnapshot( `"reading assets/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.txt..."` @@ -1002,9 +991,6 @@ export default{ %s If you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new." `); - expect(`${error}`).toMatchInlineSnapshot( - `"Error: The asset path key \\"assets/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\\","` - ); }); });