forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@angular/cli): throw xi18n errors
Fixes angular#8065
- Loading branch information
1 parent
56d7421
commit 9c5668e
Showing
2 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { ng } from '../../utils/process'; | ||
import { writeFile } from '../../utils/fs'; | ||
import { expectToFail } from '../../utils/utils'; | ||
import { join } from 'path'; | ||
|
||
export default function() { | ||
return ng('generate', 'component', 'i18n-test') | ||
.then(() => writeFile( | ||
join('src/app/i18n-test', 'i18n-test.component.html'), | ||
'<p i18n>Hello world <span i18n>inner</span></p>')) | ||
.then(() => expectToFail(() => ng('xi18n'))) | ||
.then(({ message }) => { | ||
if (!message.includes('Could not mark an element as' + | ||
' translatable inside a translatable section')) { | ||
throw new Error(`Expected i18n extraction error, got this instead:\n${message}`); | ||
} | ||
}); | ||
} |