File tree 3 files changed +38
-51
lines changed
3 files changed +38
-51
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { join } from 'path' ;
2
+ import { ng } from '../../utils/process' ;
3
+ import {
4
+ expectFileToExist , deleteFile , writeFile ,
5
+ expectFileToMatch
6
+ } from '../../utils/fs' ;
7
+
8
+
9
+ export default function ( ) {
10
+ const testComponentDir = join ( 'src/app' , 'i18n-test' ) ;
11
+ return ng ( 'generate' , 'component' , 'i18n-test' )
12
+ . then ( ( ) => deleteFile ( join ( testComponentDir , 'i18n-test.component.html' ) ) )
13
+ . then ( ( ) => writeFile (
14
+ join ( testComponentDir , 'i18n-test.component.html' ) ,
15
+ '<p i18n>Hello world</p>' ) )
16
+ . then ( ( ) => ng ( 'xi18n' ) )
17
+ . then ( ( ) => expectFileToExist ( join ( 'src' , 'messages.xlf' ) ) )
18
+ . then ( ( ) => expectFileToMatch ( join ( 'src' , 'messages.xlf' ) , / H e l l o w o r l d / ) ) ;
19
+ }
Original file line number Diff line number Diff line change
1
+ import { join } from 'path' ;
2
+ import { ng } from '../../utils/process' ;
3
+ import {
4
+ expectFileToExist , deleteFile , writeFile ,
5
+ expectFileToMatch
6
+ } from '../../utils/fs' ;
7
+
8
+
9
+ export default function ( ) {
10
+ const testComponentDir = join ( 'src/app' , 'i18n-test' ) ;
11
+ return ng ( 'generate' , 'component' , 'i18n-test' )
12
+ . then ( ( ) => deleteFile ( join ( testComponentDir , 'i18n-test.component.html' ) ) )
13
+ . then ( ( ) => writeFile (
14
+ join ( testComponentDir , 'i18n-test.component.html' ) ,
15
+ '<p i18n>Hello world</p>' ) )
16
+ . then ( ( ) => ng ( 'xi18n' , '--format=xmb' ) )
17
+ . then ( ( ) => expectFileToExist ( join ( 'src' , 'messages.xmb' ) ) )
18
+ . then ( ( ) => expectFileToMatch ( join ( 'src' , 'messages.xmb' ) , / H e l l o w o r l d / ) ) ;
19
+ }
You can’t perform that action at this time.
0 commit comments