From bd4b14e995d879f56c082fdab53a37eaae0d0371 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 14 Mar 2024 23:51:24 +0100 Subject: [PATCH] Fix tests --- packages/string-templates/src/helpers/index.ts | 4 ++-- packages/string-templates/test/helpers.spec.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/string-templates/src/helpers/index.ts b/packages/string-templates/src/helpers/index.ts index e95ac9d2fd..595440ad55 100644 --- a/packages/string-templates/src/helpers/index.ts +++ b/packages/string-templates/src/helpers/index.ts @@ -51,11 +51,11 @@ const HELPERS = [ if (value && (value as any).string) { value = (value as any).string } - let text = value + let text: any = value if (__opts && __opts.escapeNewlines) { text = value.replace(/\n/g, "\\n") } - text = new SafeString(text.replace(/&/g, "&")).toString() + text = new SafeString(text.replace(/&/g, "&")) if (text == null || typeof text !== "string") { return text } diff --git a/packages/string-templates/test/helpers.spec.ts b/packages/string-templates/test/helpers.spec.ts index efa6b0fdc3..f66eb9ef33 100644 --- a/packages/string-templates/test/helpers.spec.ts +++ b/packages/string-templates/test/helpers.spec.ts @@ -342,14 +342,14 @@ describe("Test the literal helper", () => { }) it("should allow use of the literal specifier for an object", async () => { - const output = await processString(`{{literal a}}`, { + const output: any = await processString(`{{literal a}}`, { a: { b: 1 }, }) expect(output.b).toBe(1) }) it("should allow use of the literal specifier for an object with dashes", async () => { - const output = await processString(`{{literal a}}`, { + const output: any = await processString(`{{literal a}}`, { a: { b: "i-have-dashes" }, }) expect(output.b).toBe("i-have-dashes")