@@ -73,9 +73,7 @@ describe('luis:build cli parameters test', () => {
7373} )
7474
7575describe ( 'luis:build create a new application successfully' , ( ) => {
76- before ( async function ( ) {
77- await fs . ensureDir ( path . join ( __dirname , './../../../results/' ) )
78-
76+ before ( function ( ) {
7977 nock ( 'https://westus.api.cognitive.microsoft.com' )
8078 . get ( uri => uri . includes ( 'apps' ) )
8179 . reply ( 200 , [ {
@@ -115,13 +113,9 @@ describe('luis:build create a new application successfully', () => {
115113 } )
116114 } )
117115
118- after ( async function ( ) {
119- await fs . remove ( path . join ( __dirname , './../../../results/' ) )
120- } )
121-
122116 test
123117 . stdout ( )
124- . command ( [ 'luis:build' , '--in' , './test/fixtures/testcases/lubuild/sandwich//lufiles/sandwich.en-us.lu' , '--authoringKey' , uuidv1 ( ) , '--botName' , 'test' , '--log' , '--suffix' , 'development' , '--out' , './results' ] )
118+ . command ( [ 'luis:build' , '--in' , './test/fixtures/testcases/lubuild/sandwich//lufiles/sandwich.en-us.lu' , '--authoringKey' , uuidv1 ( ) , '--botName' , 'test' , '--log' , '--suffix' , 'development' ] )
125119 . it ( 'should create a new application successfully' , ctx => {
126120 expect ( ctx . stdout ) . to . contain ( 'Handling applications...' )
127121 expect ( ctx . stdout ) . to . contain ( 'Creating LUIS.ai application' )
@@ -134,9 +128,7 @@ describe('luis:build create a new application successfully', () => {
134128
135129describe ( 'luis:build update application succeed when utterances changed' , ( ) => {
136130 const existingLuisApp = require ( './../../fixtures/testcases/lubuild/sandwich/luis/test(development)-sandwich.utteranceChanged.en-us.lu.json' )
137- before ( async function ( ) {
138- await fs . ensureDir ( path . join ( __dirname , './../../../results/' ) )
139-
131+ before ( function ( ) {
140132 nock ( 'https://westus.api.cognitive.microsoft.com' )
141133 . get ( uri => uri . includes ( 'apps' ) )
142134 . reply ( 200 , [ {
@@ -186,13 +178,9 @@ describe('luis:build update application succeed when utterances changed', () =>
186178 } )
187179 } )
188180
189- after ( async function ( ) {
190- await fs . remove ( path . join ( __dirname , './../../../results/' ) )
191- } )
192-
193181 test
194182 . stdout ( )
195- . command ( [ 'luis:build' , '--in' , './test/fixtures/testcases/lubuild/sandwich/lufiles/sandwich.en-us.lu' , '--authoringKey' , uuidv1 ( ) , '--botName' , 'test' , '--log' , '--suffix' , 'development' , '--out' , './results' ] )
183+ . command ( [ 'luis:build' , '--in' , './test/fixtures/testcases/lubuild/sandwich/lufiles/sandwich.en-us.lu' , '--authoringKey' , uuidv1 ( ) , '--botName' , 'test' , '--log' , '--suffix' , 'development' ] )
196184 . it ( 'should update a luis application when utterances changed' , ctx => {
197185 expect ( ctx . stdout ) . to . contain ( 'Handling applications...' )
198186 expect ( ctx . stdout ) . to . contain ( 'creating version=0.2' )
@@ -205,9 +193,7 @@ describe('luis:build update application succeed when utterances changed', () =>
205193
206194describe ( 'luis:build update application succeed when utterances added' , ( ) => {
207195 const existingLuisApp = require ( './../../fixtures/testcases/lubuild/sandwich/luis/test(development)-sandwich.utteranceAdded.en-us.lu.json' )
208- before ( async function ( ) {
209- await fs . ensureDir ( path . join ( __dirname , './../../../results/' ) )
210-
196+ before ( function ( ) {
211197 nock ( 'https://westus.api.cognitive.microsoft.com' )
212198 . get ( uri => uri . includes ( 'apps' ) )
213199 . reply ( 200 , [ {
@@ -257,13 +243,9 @@ describe('luis:build update application succeed when utterances added', () => {
257243 } )
258244 } )
259245
260- after ( async function ( ) {
261- await fs . remove ( path . join ( __dirname , './../../../results/' ) )
262- } )
263-
264246 test
265247 . stdout ( )
266- . command ( [ 'luis:build' , '--in' , './test/fixtures/testcases/lubuild/sandwich/lufiles/sandwich.en-us.lu' , '--authoringKey' , uuidv1 ( ) , '--botName' , 'test' , '--log' , '--suffix' , 'development' , '--out' , './results' ] )
248+ . command ( [ 'luis:build' , '--in' , './test/fixtures/testcases/lubuild/sandwich/lufiles/sandwich.en-us.lu' , '--authoringKey' , uuidv1 ( ) , '--botName' , 'test' , '--log' , '--suffix' , 'development' ] )
267249 . it ( 'should update a luis application when utterances added' , ctx => {
268250 expect ( ctx . stdout ) . to . contain ( 'Handling applications...' )
269251 expect ( ctx . stdout ) . to . contain ( 'creating version=0.2' )
@@ -276,9 +258,7 @@ describe('luis:build update application succeed when utterances added', () => {
276258
277259describe ( 'luis:build not update application if no changes' , ( ) => {
278260 const existingLuisApp = require ( './../../fixtures/testcases/lubuild/sandwich/luis/test(development)-sandwich.en-us.lu.json' )
279- before ( async function ( ) {
280- await fs . ensureDir ( path . join ( __dirname , './../../../results/' ) )
281-
261+ before ( function ( ) {
282262 nock ( 'https://westus.api.cognitive.microsoft.com' )
283263 . get ( uri => uri . includes ( 'apps' ) )
284264 . reply ( 200 , [ {
@@ -299,13 +279,9 @@ describe('luis:build not update application if no changes', () => {
299279 . reply ( 200 , existingLuisApp )
300280 } )
301281
302- after ( async function ( ) {
303- await fs . remove ( path . join ( __dirname , './../../../results/' ) )
304- } )
305-
306282 test
307283 . stdout ( )
308- . command ( [ 'luis:build' , '--in' , './test/fixtures/testcases/lubuild/sandwich/lufiles/sandwich.en-us.lu' , '--authoringKey' , uuidv1 ( ) , '--botName' , 'test' , '--log' , '--suffix' , 'development' , '--out' , './results' ] )
284+ . command ( [ 'luis:build' , '--in' , './test/fixtures/testcases/lubuild/sandwich/lufiles/sandwich.en-us.lu' , '--authoringKey' , uuidv1 ( ) , '--botName' , 'test' , '--log' , '--suffix' , 'development' ] )
309285 . it ( 'should not update a luis application when there are no changes for the coming lu file' , ctx => {
310286 expect ( ctx . stdout ) . to . contain ( 'Handling applications...' )
311287 expect ( ctx . stdout ) . to . contain ( 'no changes' )
@@ -343,7 +319,7 @@ describe('luis:build write dialog assets successfully if --dialog set to multiLa
343319
344320 test
345321 . stdout ( )
346- . command ( [ 'luis:build' , '--in' , './test/fixtures/testcases/lubuild/sandwich/lufiles/sandwich.en-us.lu' , '--authoringKey' , uuidv1 ( ) , '--botName' , 'test' , '--dialog' , 'multiLanguage' , '-- out', './results' , '--log' , '--suffix' , 'development' ] )
322+ . command ( [ 'luis:build' , '--in' , './test/fixtures/testcases/lubuild/sandwich/lufiles/sandwich.en-us.lu' , '--authoringKey' , uuidv1 ( ) , '--botName' , 'test' , '--out' , './results' , '--log' , '--suffix' , 'development' ] )
347323 . it ( 'should write dialog assets successfully when --dialog set to multiLanguage' , async ctx => {
348324 expect ( await compareFiles ( './../../../results/luis.settings.development.westus.json' , './../../fixtures/testcases/lubuild/sandwich/config/luis.settings.development.westus.json' ) ) . to . be . true
349325 expect ( await compareFiles ( './../../../results/sandwich.en-us.lu.dialog' , './../../fixtures/testcases/lubuild/sandwich/dialogs/sandwich.en-us.lu.dialog' ) ) . to . be . true
@@ -642,9 +618,7 @@ describe('luis:build update dialog assets successfully when dialog assets exist'
642618
643619describe ( 'luis:build not update application if only cases of utterances or patterns are changed' , ( ) => {
644620 const existingLuisApp = require ( './../../fixtures/testcases/lubuild/case-insensitive/luis/test(development)-case-insensitive.en-us.lu.json' )
645- before ( async function ( ) {
646- await fs . ensureDir ( path . join ( __dirname , './../../../results/' ) )
647-
621+ before ( function ( ) {
648622 nock ( 'https://westus.api.cognitive.microsoft.com' )
649623 . get ( uri => uri . includes ( 'apps' ) )
650624 . reply ( 200 , [ {
@@ -665,13 +639,9 @@ describe('luis:build not update application if only cases of utterances or patte
665639 . reply ( 200 , existingLuisApp )
666640 } )
667641
668- after ( async function ( ) {
669- await fs . remove ( path . join ( __dirname , './../../../results/' ) )
670- } )
671-
672642 test
673643 . stdout ( )
674- . command ( [ 'luis:build' , '--in' , './test/fixtures/testcases/lubuild/case-insensitive/lufiles/case-insensitive.lu' , '--authoringKey' , uuidv1 ( ) , '--botName' , 'test' , '--log' , '--suffix' , 'development' , '--out' , './results' ] )
644+ . command ( [ 'luis:build' , '--in' , './test/fixtures/testcases/lubuild/case-insensitive/lufiles/case-insensitive.lu' , '--authoringKey' , uuidv1 ( ) , '--botName' , 'test' , '--log' , '--suffix' , 'development' ] )
675645 . it ( 'should not update a luis application when only cases of utterances or patterns are different for the coming lu file' , ctx => {
676646 expect ( ctx . stdout ) . to . contain ( 'Handling applications...' )
677647 expect ( ctx . stdout ) . to . contain ( 'no changes' )
@@ -755,7 +725,6 @@ describe('luis:build update application succeed with parameters set from luconfi
755725 . stdout ( )
756726 . command ( [ 'luis:build' , '--authoringKey' , uuidv1 ( ) , '--luConfig' , './test/fixtures/testcases/lubuild/luconfig/lufiles/luconfig.json' , '--log' , '--suffix' , 'development' ] )
757727 . it ( 'should update a luis application when utterances changed' , async ctx => {
758- console . log ( ctx )
759728 expect ( ctx . stdout ) . to . contain ( 'Handling applications...' )
760729 expect ( ctx . stdout ) . to . contain ( 'creating version=0.2' )
761730 expect ( ctx . stdout ) . to . contain ( 'deleting old version=0.1' )
@@ -771,9 +740,7 @@ describe('luis:build update application succeed with parameters set from luconfi
771740} )
772741
773742describe ( 'luis:build create a new application successfully with locale set to it-it' , ( ) => {
774- before ( async function ( ) {
775- await fs . ensureDir ( path . join ( __dirname , './../../../results/' ) )
776-
743+ before ( function ( ) {
777744 nock ( 'https://westus.api.cognitive.microsoft.com' )
778745 . get ( uri => uri . includes ( 'apps' ) )
779746 . reply ( 200 , [ {
@@ -813,13 +780,9 @@ describe('luis:build create a new application successfully with locale set to it
813780 } )
814781 } )
815782
816- after ( async function ( ) {
817- await fs . remove ( path . join ( __dirname , './../../../results/' ) )
818- } )
819-
820783 test
821784 . stdout ( )
822- . command ( [ 'luis:build' , '--in' , './test/fixtures/testcases/lubuild/file-with-personName/personName.en-us.lu' , '--authoringKey' , uuidv1 ( ) , '--botName' , 'test' , '--log' , '--suffix' , 'development' , '--out' , './results' , '-- defaultCulture', 'it-it' ] )
785+ . command ( [ 'luis:build' , '--in' , './test/fixtures/testcases/lubuild/file-with-personName/personName.en-us.lu' , '--authoringKey' , uuidv1 ( ) , '--botName' , 'test' , '--log' , '--suffix' , 'development' , '--defaultCulture' , 'it-it' ] )
823786 . it ( 'should create a new application successfully for prebuilt entity personName with locale set to it-it' , ctx => {
824787 expect ( ctx . stdout ) . to . contain ( 'Handling applications...' )
825788 expect ( ctx . stdout ) . to . contain ( 'Creating LUIS.ai application' )
0 commit comments