@@ -90,7 +90,7 @@ describe('CLI Deploy Command', () => {
9090 expect ( await testDb . exists ( 'table' , 'myfirstapp.users' ) ) . toBe ( true ) ;
9191 expect ( await testDb . exists ( 'table' , 'myfirstapp.products' ) ) . toBe ( true ) ;
9292
93- const revertCommands = `lql revert --database $database --yes` ;
93+ const revertCommands = `lql revert --database $database --package my-first --yes` ;
9494 await fixture . runTerminalCommands ( revertCommands , {
9595 database : testDb . name
9696 } , true ) ;
@@ -99,4 +99,22 @@ describe('CLI Deploy Command', () => {
9999 expect ( await testDb . exists ( 'table' , 'myfirstapp.users' ) ) . toBe ( false ) ;
100100 expect ( await testDb . exists ( 'table' , 'myfirstapp.products' ) ) . toBe ( false ) ;
101101 } ) ;
102+
103+
104+ it ( 'should deploy with --no-recursive flag' , async ( ) => {
105+ const commands = `lql deploy --database ${ testDb . name } --package my-first --no-recursive --yes` ;
106+
107+ await fixture . runTerminalCommands ( commands , {
108+ database : testDb . name
109+ } , true ) ;
110+
111+ expect ( await testDb . exists ( 'schema' , 'myfirstapp' ) ) . toBe ( true ) ;
112+ expect ( await testDb . exists ( 'table' , 'myfirstapp.users' ) ) . toBe ( true ) ;
113+ expect ( await testDb . exists ( 'table' , 'myfirstapp.products' ) ) . toBe ( true ) ;
114+
115+ const deployedChanges = await testDb . getDeployedChanges ( ) ;
116+ expect ( deployedChanges . some ( ( change : any ) => change . package === 'my-first' ) ) . toBe ( true ) ;
117+ expect ( deployedChanges . find ( ( change : any ) => change . package === 'my-second' ) ) . toBeFalsy ( ) ;
118+ expect ( deployedChanges . find ( ( change : any ) => change . package === 'my-third' ) ) . toBeFalsy ( ) ;
119+ } ) ;
102120} ) ;
0 commit comments