(bugfix) order of keys was not preserved when using namespaced-json format. Closes #131

This commit is contained in:
Kim Biesbjerg
2019-08-02 13:34:18 +02:00
parent 3cbc20e0a0
commit a5b8f6e6c6
3 changed files with 13 additions and 5 deletions

View File

@@ -57,4 +57,13 @@ describe('NamespacedJsonCompiler', () => {
expect(result).to.equal('{\n "NAMESPACE": {\n "KEY": {\n "FIRST_KEY": "",\n "SECOND_KEY": "VALUE"\n }\n }\n}');
});
it('should not reorder keys when compiled', () => {
const collection = new TranslationCollection({
'BROWSE': '',
'LOGIN': ''
});
const result: string = compiler.compile(collection);
expect(result).to.equal('{\n\t"BROWSE": "",\n\t"LOGIN": ""\n}');
});
});