@@ -11,85 +11,90 @@ const compareSourceFiles = async function (file1: string, file2: string) {
1111}
1212
1313describe ( 'luis:generate:ts' , ( ) => {
14+ before ( async function ( ) {
15+ await fs . ensureDir ( path . join ( __dirname , '../../../fixtures/generate/results' ) )
16+ } )
17+
1418 after ( async function ( ) {
15- await fs . emptyDir ( path . join ( __dirname , 'test_data/result_ts ' ) )
19+ await fs . emptyDir ( path . join ( __dirname , '../../../fixtures/generate/results ' ) )
1620 } )
1721
22+
1823 test
1924 . stdout ( )
2025 . command ( [ 'luis:generate:ts' ,
2126 '--in' ,
22- `${ path . join ( __dirname , 'test_data /Intents.json' ) } ` ,
27+ `${ path . join ( __dirname , '../../../fixtures/generate /Intents.json' ) } ` ,
2328 '--out' ,
24- `${ path . join ( __dirname , 'test_data/result_ts /intents.ts' ) } ` ] )
29+ `${ path . join ( __dirname , '../../../fixtures/generate/results /intents.ts' ) } ` ] )
2530 . it ( 'Generates intents correctly' , async ( ) => {
26- await compareSourceFiles ( 'test_data/ intents.ts' , 'test_data/result_ts /intents.ts' )
31+ await compareSourceFiles ( '../../../fixtures/generate/ intents.ts' , '../../../fixtures/generate/results /intents.ts' )
2732 } )
2833
2934 test
3035 . stdout ( )
3136 . command ( [ 'luis:generate:ts' ,
3237 '--in' ,
33- `${ path . join ( __dirname , 'test_data /SimpleEntities.json' ) } ` ,
38+ `${ path . join ( __dirname , '../../../fixtures/generate /SimpleEntities.json' ) } ` ,
3439 '--out' ,
35- `${ path . join ( __dirname , 'test_data/result_ts /simple-entities.ts' ) } ` ] )
40+ `${ path . join ( __dirname , '../../../fixtures/generate/results /simple-entities.ts' ) } ` ] )
3641 . it ( 'Generates simple entities correctly' , async ( ) => {
37- await compareSourceFiles ( 'test_data/ simple-entities.ts' , 'test_data/result_ts /simple-entities.ts' )
42+ await compareSourceFiles ( '../../../fixtures/generate/ simple-entities.ts' , '../../../fixtures/generate/results /simple-entities.ts' )
3843 } )
3944
4045 test
4146 . stdout ( )
4247 . command ( [ 'luis:generate:ts' ,
4348 '--in' ,
44- `${ path . join ( __dirname , 'test_data /CompositeEntities.json' ) } ` ,
49+ `${ path . join ( __dirname , '../../../fixtures/generate /CompositeEntities.json' ) } ` ,
4550 '--out' ,
46- `${ path . join ( __dirname , 'test_data/result_ts /composite-entities.ts' ) } ` ] )
51+ `${ path . join ( __dirname , '../../../fixtures/generate/results /composite-entities.ts' ) } ` ] )
4752 . it ( 'Generates composites entities correctly' , async ( ) => {
48- await compareSourceFiles ( 'test_data/ composite-entities.ts' , 'test_data/result_ts /composite-entities.ts' )
53+ await compareSourceFiles ( '../../../fixtures/generate/ composite-entities.ts' , '../../../fixtures/generate/results /composite-entities.ts' )
4954 } )
5055
5156 test
5257 . stdout ( )
5358 . command ( [ 'luis:generate:ts' ,
5459 '--in' ,
55- `${ path . join ( __dirname , 'test_data /ClosedLists.json' ) } ` ,
60+ `${ path . join ( __dirname , '../../../fixtures/generate /ClosedLists.json' ) } ` ,
5661 '--out' ,
57- `${ path . join ( __dirname , 'test_data/result_ts /closed-lists.ts' ) } ` ] )
62+ `${ path . join ( __dirname , '../../../fixtures/generate/results /closed-lists.ts' ) } ` ] )
5863 . it ( 'Generates closed lists entities correctly' , async ( ) => {
59- await compareSourceFiles ( 'test_data/ closed-lists.ts' , 'test_data/result_ts /closed-lists.ts' )
64+ await compareSourceFiles ( '../../../fixtures/generate/ closed-lists.ts' , '../../../fixtures/generate/results /closed-lists.ts' )
6065 } )
6166
6267 test
6368 . stdout ( )
6469 . command ( [ 'luis:generate:ts' ,
6570 '--in' ,
66- `${ path . join ( __dirname , 'test_data /PatternEntities.json' ) } ` ,
71+ `${ path . join ( __dirname , '../../../fixtures/generate /PatternEntities.json' ) } ` ,
6772 '--out' ,
68- `${ path . join ( __dirname , 'test_data/result_ts /pattern-entities.ts' ) } ` ] )
73+ `${ path . join ( __dirname , '../../../fixtures/generate/results /pattern-entities.ts' ) } ` ] )
6974 . it ( 'Generates pattern entities correctly' , async ( ) => {
70- await compareSourceFiles ( 'test_data/ pattern-entities.ts' , 'test_data/result_ts /pattern-entities.ts' )
75+ await compareSourceFiles ( '../../../fixtures/generate/ pattern-entities.ts' , '../../../fixtures/generate/results /pattern-entities.ts' )
7176 } )
7277
7378 test
7479 . stdout ( )
7580 . command ( [ 'luis:generate:ts' ,
7681 '--in' ,
77- `${ path . join ( __dirname , 'test_data /RegexEntities.json' ) } ` ,
82+ `${ path . join ( __dirname , '../../../fixtures/generate /RegexEntities.json' ) } ` ,
7883 '--out' ,
79- `${ path . join ( __dirname , 'test_data/result_ts /regex-entities.ts' ) } ` ] )
84+ `${ path . join ( __dirname , '../../../fixtures/generate/results /regex-entities.ts' ) } ` ] )
8085 . it ( 'Generates regex entities correctly' , async ( ) => {
81- await compareSourceFiles ( 'test_data/ regex-entities.ts' , 'test_data/result_ts /regex-entities.ts' )
86+ await compareSourceFiles ( '../../../fixtures/generate/ regex-entities.ts' , '../../../fixtures/generate/results /regex-entities.ts' )
8287 } )
8388
8489 test
8590 . stdout ( )
8691 . command ( [ 'luis:generate:ts' ,
8792 '--in' ,
88- `${ path . join ( __dirname , 'test_data /PrebuiltEntities.json' ) } ` ,
93+ `${ path . join ( __dirname , '../../../fixtures/generate /PrebuiltEntities.json' ) } ` ,
8994 '--out' ,
90- `${ path . join ( __dirname , 'test_data/result_ts /prebuilt-entities.ts' ) } ` ] )
95+ `${ path . join ( __dirname , '../../../fixtures/generate/results /prebuilt-entities.ts' ) } ` ] )
9196 . it ( 'Generates prebuilt entities correctly' , async ( ) => {
92- await compareSourceFiles ( 'test_data/ prebuilt-entities.ts' , 'test_data/result_ts /prebuilt-entities.ts' )
97+ await compareSourceFiles ( '../../../fixtures/generate/ prebuilt-entities.ts' , '../../../fixtures/generate/results /prebuilt-entities.ts' )
9398 } )
9499
95100} )
0 commit comments