From 89748198b4619df7d5b0a104bc183f3f367d9695 Mon Sep 17 00:00:00 2001 From: Dilip Kola Date: Tue, 18 Jun 2024 09:36:19 +0530 Subject: [PATCH] chore: add test case for indentation --- src/reverse_translator.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/reverse_translator.test.ts diff --git a/src/reverse_translator.test.ts b/src/reverse_translator.test.ts new file mode 100644 index 0000000..d40c6c2 --- /dev/null +++ b/src/reverse_translator.test.ts @@ -0,0 +1,12 @@ +import { JsonTemplateEngine } from './engine'; + +describe('reverse_translator', () => { + it('should reverse translate with indentation', () => { + const template = JsonTemplateEngine.reverseTranslate( + JsonTemplateEngine.parse(`{a: {b: {c: 1}}}`), + ); + expect(template).toEqual( + '{\n "a": {\n "b": {\n "c": 1\n }\n }\n}', + ); + }); +});