templateFormatter: fix empty string args not getting counted as arguments; add concat base template function

This commit is contained in:
Dragory 2019-03-16 16:39:07 +02:00
parent f7f08ffd3b
commit 8f898ed972
2 changed files with 14 additions and 1 deletions

View file

@ -99,3 +99,13 @@ test("Edge case #1", async () => {
const result = await renderTemplate("{foo} {bar()}");
// No "Unclosed function" exception = success
});
test("Parses empty string args as empty strings", async () => {
const result = parseTemplate('{foo("")}');
expect(result).toEqual([
{
identifier: "foo",
args: [""],
},
]);
});