extract strings when TranslateService is accessed directly via constructor parameter. Closes #50 and #106

This commit is contained in:
Kim Biesbjerg
2020-03-22 13:33:40 +01:00
parent b07d929484
commit 33d8c26a28
3 changed files with 63 additions and 9 deletions

View File

@@ -11,6 +11,18 @@ describe('ServiceParser', () => {
parser = new ServiceParser();
});
it('should extract strings when TranslateService is accessed directly via constructor parameter', () => {
const contents = `
@Component({ })
export class MyComponent {
public constructor(protected translateService: TranslateService) {
translateService.get('It works!');
}
`;
const keys = parser.extract(contents, componentFilename).keys();
expect(keys).to.deep.equal(['It works!']);
});
it('should support extracting binary expressions', () => {
const contents = `
@Component({ })