From 3e6a1f0bc457449c80c377dbcaed0bc595559674 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Tue, 22 Jan 2019 18:48:49 +0100 Subject: [PATCH] build: fix outdated i18n compiler-cli test assertions (#28191) PR Close #28191 --- .../integrationtest/src/messages.fi.xlf | 8 ++++--- .../integrationtest/test/i18n_spec.ts | 22 +++++++++---------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/compiler-cli/integrationtest/src/messages.fi.xlf b/packages/compiler-cli/integrationtest/src/messages.fi.xlf index 1bc59fc41f..2b9e6058d0 100644 --- a/packages/compiler-cli/integrationtest/src/messages.fi.xlf +++ b/packages/compiler-cli/integrationtest/src/messages.fi.xlf @@ -13,9 +13,11 @@ tervetuloa - other-3rdP-component - other-3rdP-component + other-3rdP-component +multi-lines + other-3rdP-component +multi-lines - \ No newline at end of file + diff --git a/packages/compiler-cli/integrationtest/test/i18n_spec.ts b/packages/compiler-cli/integrationtest/test/i18n_spec.ts index 0872e96660..773a7b6e04 100644 --- a/packages/compiler-cli/integrationtest/test/i18n_spec.ts +++ b/packages/compiler-cli/integrationtest/test/i18n_spec.ts @@ -36,8 +36,8 @@ const EXPECTED_XMB = ` node_modules/third_party/other_comp.d.ts:1,2other-3rdP-component multi-lines - src/basic.ts:1translate me - src/basic.ts:5src/entry_components.ts:1Welcome + src/basic.html:1translate me + src/basic.html:5src/entry_components.ts:1Welcome `; @@ -56,7 +56,7 @@ multi-lines translate me - src/basic.ts + src/basic.html 1 desc @@ -65,7 +65,7 @@ multi-lines Welcome - src/basic.ts + src/basic.html 5 @@ -94,7 +94,7 @@ multi-lines desc meaning - src/basic.ts:1 + src/basic.html:1 translate me @@ -102,7 +102,7 @@ multi-lines - src/basic.ts:5 + src/basic.html:5 src/entry_components.ts:1 @@ -114,31 +114,31 @@ multi-lines `; describe('template i18n extraction output', () => { - const outDir = 'out'; + const outputDir = path.join(__dirname, '../xi18n-out'); it('should extract i18n messages as xmb', () => { - const xmbOutput = path.join(outDir, 'custom_file.xmb'); + const xmbOutput = path.join(outputDir, 'custom_file.xmb'); expect(fs.existsSync(xmbOutput)).toBeTruthy(); const xmb = fs.readFileSync(xmbOutput, {encoding: 'utf-8'}); expect(xmb).toEqual(EXPECTED_XMB); }); it('should extract i18n messages as xliff', () => { - const xlfOutput = path.join(outDir, 'messages.xlf'); + const xlfOutput = path.join(outputDir, 'messages.xlf'); expect(fs.existsSync(xlfOutput)).toBeTruthy(); const xlf = fs.readFileSync(xlfOutput, {encoding: 'utf-8'}); expect(xlf).toEqual(EXPECTED_XLIFF); }); it('should extract i18n messages as xliff version 2.0', () => { - const xlfOutput = path.join(outDir, 'messages.xliff2.xlf'); + const xlfOutput = path.join(outputDir, 'messages.xliff2.xlf'); expect(fs.existsSync(xlfOutput)).toBeTruthy(); const xlf = fs.readFileSync(xlfOutput, {encoding: 'utf-8'}); expect(xlf).toEqual(EXPECTED_XLIFF2); }); it('should not emit js', () => { - const files = fs.readdirSync(outDir); + const files = fs.readdirSync(outputDir); files.forEach(f => expect(f).not.toMatch(/\.js$/)); }); });