added tests

This commit is contained in:
Kim Biesbjerg
2019-07-08 14:36:44 +02:00
parent 9e5dad362c
commit f9b3c63c4c
2 changed files with 21 additions and 0 deletions

View File

@@ -30,6 +30,12 @@ describe('PipeParser', () => {
expect(keys).to.deep.equal(['World']);
});
it('should extract interpolated strings when translate pipe is used in conjunction with other pipes', () => {
const contents = `Hello {{ 'World' | translate | upper }}`;
const keys = parser.extract(contents, templateFilename).keys();
expect(keys).to.deep.equal(['World']);
});
it('should extract strings with escaped quotes', () => {
const contents = `Hello {{ 'World\\'s largest potato' | translate }}`;
const keys = parser.extract(contents, templateFilename).keys();