This commit is contained in:
Adria Navarro 2024-01-22 12:16:52 +01:00
parent 537eae7b98
commit dc0bef20d8
2 changed files with 4 additions and 3 deletions

View File

@ -126,7 +126,7 @@
"array"
],
"numArgs": 1,
"example": "{{ sum 1 2 3 }} -> 6",
"example": "{{ sum '[1, 2, 3]' }} -> 6",
"description": "<p>Returns the sum of all numbers in the given array.</p>\n"
}
},

View File

@ -26,9 +26,10 @@ describe("manifest", () => {
it.each(examples)("%s - %s", async (collection, func) => {
const example = manifest[collection][func].example
const [hbs, js] = example.split("->").map(x => x.trim())
let [hbs, js] = example.split("->").map(x => x.trim())
hbs = hbs.replace(/'\[1, 2, 3\]'/, "array")
expect(await processString(hbs)).toEqual(js)
expect(await processString(hbs, { array: [1, 2, 3] })).toEqual(js)
})
})
})