Add CLI option to enable alphabetical sorting of extracted keys

This commit is contained in:
Gustav Gahm
2017-01-13 06:05:52 +01:00
committed by Kim Biesbjerg
parent 94e6416c76
commit c18b7dc9c7
3 changed files with 24 additions and 0 deletions

View File

@@ -79,4 +79,10 @@ describe('StringCollection', () => {
expect(collection.intersect(newCollection).values).to.deep.equal({ red: 'rød', blue: 'blå' });
});
it('should sort translations in alphabetical order', () => {
collection = new TranslationCollection({ red: 'rød', green: 'grøn', blue: 'blå' });
collection = collection.sort();
expect(collection.keys()).deep.equal(['blue', 'green', 'red']);
});
});