From eb7f3f603e3d292ab920f37a1cb8aa10d888008e Mon Sep 17 00:00:00 2001 From: Kim Biesbjerg Date: Mon, 16 Sep 2019 16:58:21 +0200 Subject: [PATCH] (test) (thanks, @adrienverge) --- tests/parsers/marker.parser.spec.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/parsers/marker.parser.spec.ts b/tests/parsers/marker.parser.spec.ts index 3e0042a..a8a5669 100644 --- a/tests/parsers/marker.parser.spec.ts +++ b/tests/parsers/marker.parser.spec.ts @@ -27,4 +27,19 @@ describe('MarkerParser', () => { expect(keys).to.deep.equal(['Hello world', 'I', 'am', 'extracted', 'binary expression', 'conditional operator', 'FOO.bar']); }); + it('should extract split strings', () => { + const contents = ` + import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; + _('Hello ' + 'world'); + _('This is a ' + 'very ' + 'very ' + 'very ' + 'very ' + 'long line.'); + _('Mix ' + \`of \` + 'different ' + \`types\`); + `; + const keys = parser.extract(contents, componentFilename).keys(); + expect(keys).to.deep.equal([ + 'Hello world', + 'This is a very very very very long line.', + 'Mix of different types' + ]); + }); + });