From c59750cc9ea38ee9708505b4c9bb3f313519f4ca Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 22 Jan 2024 12:24:03 +0100 Subject: [PATCH] Fix some array tests --- packages/string-templates/test/manifest.spec.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index 1e1f58dae0..38033a377e 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -27,9 +27,20 @@ describe("manifest", () => { const example = manifest[collection][func].example let [hbs, js] = example.split("->").map(x => x.trim()) - hbs = hbs.replace(/\[1, 2, 3\]/, "array") + hbs = hbs.replace(/\[1, 2, 3\]/, "array3") + hbs = hbs.replace(/\[1, 2, 3, 4\]/, "array4") - expect(await processString(hbs, { array: [1, 2, 3] })).toEqual(js) + if (js === undefined) { + // The function has no return value + return + } + + expect( + await processString(hbs, { + array3: [1, 2, 3], + array4: [1, 2, 3, 4], + }) + ).toEqual(js) }) }) })