1
0
Fork 0
mirror of synced 2024-10-02 10:08:09 +13:00

Fix tests

This commit is contained in:
Adria Navarro 2024-03-14 23:51:24 +01:00
parent acbb06edf7
commit bd4b14e995
2 changed files with 4 additions and 4 deletions

View file

@ -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
}

View file

@ -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")