From 7928036a1b9f9d6891c90842222209539b9ebfae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 16 Nov 2020 21:50:06 -0500 Subject: [PATCH] feat: add test for custom translations --- test/translator.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/translator.js b/test/translator.js index 628300166d..0ec24949d9 100644 --- a/test/translator.js +++ b/test/translator.js @@ -322,4 +322,12 @@ describe('Translator static methods', function () { done(); }); }); + + describe('add translation', function () { + it('should add custom translations', async function () { + shim.addTranslation('en-GB', 'my-namespace', { foo: 'a custom translation' }); + const t = await shim.translate('this is best [[my-namespace:foo]]'); + assert.strictEqual(t, 'this is best a custom translation'); + }); + }); });