1
0
Fork 0
mirror of synced 2024-07-07 07:15:43 +12:00
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" "array"
], ],
"numArgs": 1, "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" "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) => { it.each(examples)("%s - %s", async (collection, func) => {
const example = manifest[collection][func].example 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)
}) })
}) })
}) })