(bugfix) extract strings encapsulated with backticks. Closes #139

This commit is contained in:
Kim Biesbjerg
2019-08-26 12:29:52 +02:00
parent e1bb5bfd02
commit 24ebd8f428
6 changed files with 31 additions and 13 deletions

View File

@@ -122,6 +122,19 @@ describe('ServiceParser', () => {
expect(key).to.deep.equal(['Hello', 'World']);
});
it('should extract string arrays encapsulated in backticks', () => {
const contents = `
@Component({ })
export class AppComponent {
public constructor(protected _translateService: TranslateService) { }
public test() {
this._translateService.get([\`Hello\`, \`World\`]);
}
`;
const keys = parser.extract(contents, componentFilename).keys();
expect(keys).to.deep.equal(['Hello', 'World']);
});
it('should not extract strings in get()/instant()/stream() methods of other services', () => {
const contents = `
@Component({ })