@@ -138,6 +138,62 @@ describe('Database.all', () => {
138138 LONG_TIMEOUT
139139 )
140140
141+ it (
142+ 'select with one argument' ,
143+ done => {
144+ const chinook = getChinookDatabase ( )
145+ chinook . all ( 'SELECT * FROM tracks LIMIT ?' , 1 , ( err : Error , rows : SQLiteCloudRowset ) => {
146+ expect ( err ) . toBeNull ( )
147+ expect ( rows ) . toBeDefined ( )
148+ expect ( rows [ 0 ] ) . toMatchObject ( {
149+ AlbumId : 1 ,
150+ Bytes : 11170334 ,
151+ Composer : 'Angus Young, Malcolm Young, Brian Johnson' ,
152+ GenreId : 1 ,
153+ MediaTypeId : 1 ,
154+ Milliseconds : 343719 ,
155+ Name : 'For Those About To Rock (We Salute You)' ,
156+ TrackId : 1 ,
157+ UnitPrice : 0.99
158+ } )
159+
160+ chinook . close ( error => {
161+ expect ( error ) . toBeNull ( )
162+ done ( )
163+ } )
164+ } )
165+ } ,
166+ LONG_TIMEOUT
167+ )
168+
169+ it (
170+ 'select with one argument with array like ORMs' ,
171+ done => {
172+ const chinook = getChinookDatabase ( )
173+ chinook . all ( 'SELECT * FROM tracks LIMIT ?' , [ 1 ] , ( err : Error , rows : SQLiteCloudRowset ) => {
174+ expect ( err ) . toBeNull ( )
175+ expect ( rows ) . toBeDefined ( )
176+ expect ( rows [ 0 ] ) . toMatchObject ( {
177+ AlbumId : 1 ,
178+ Bytes : 11170334 ,
179+ Composer : 'Angus Young, Malcolm Young, Brian Johnson' ,
180+ GenreId : 1 ,
181+ MediaTypeId : 1 ,
182+ Milliseconds : 343719 ,
183+ Name : 'For Those About To Rock (We Salute You)' ,
184+ TrackId : 1 ,
185+ UnitPrice : 0.99
186+ } )
187+
188+ chinook . close ( error => {
189+ expect ( error ) . toBeNull ( )
190+ done ( )
191+ } )
192+ } )
193+ } ,
194+ LONG_TIMEOUT
195+ )
196+
141197 it ( 'select with empty space after semi-colon' , done => {
142198 const chinook = getChinookDatabase ( )
143199 chinook . all ( 'SELECT 1; ' , ( err : Error , rows : SQLiteCloudRowset ) => {
0 commit comments