@@ -142,10 +142,11 @@ describe('Database.all', () => {
142142 'select with one argument' ,
143143 done => {
144144 const chinook = getChinookDatabase ( )
145- chinook . all ( 'SELECT * FROM tracks LIMIT ?' , 1 , ( err : Error , rows : SQLiteCloudRowset ) => {
145+ chinook . all ( 'SELECT * FROM tracks LIMIT ?' , 1 , ( err : Error | null , rows : SQLiteCloudRow [ ] | undefined ) => {
146146 expect ( err ) . toBeNull ( )
147147 expect ( rows ) . toBeDefined ( )
148- expect ( rows [ 0 ] ) . toMatchObject ( {
148+ expect ( rows ) . toHaveLength ( 1 )
149+ expect ( rows && rows . length > 0 ? rows [ 0 ] : rows ) . toMatchObject ( {
149150 AlbumId : 1 ,
150151 Bytes : 11170334 ,
151152 Composer : 'Angus Young, Malcolm Young, Brian Johnson' ,
@@ -170,10 +171,11 @@ describe('Database.all', () => {
170171 'select with one argument with array like ORMs' ,
171172 done => {
172173 const chinook = getChinookDatabase ( )
173- chinook . all ( 'SELECT * FROM tracks LIMIT ?' , [ 1 ] , ( err : Error , rows : SQLiteCloudRowset ) => {
174+ chinook . all ( 'SELECT * FROM tracks LIMIT ?' , [ 1 ] , ( err : Error | null , rows : SQLiteCloudRow [ ] | undefined ) => {
174175 expect ( err ) . toBeNull ( )
175176 expect ( rows ) . toBeDefined ( )
176- expect ( rows [ 0 ] ) . toMatchObject ( {
177+ expect ( rows ) . toHaveLength ( 1 )
178+ expect ( rows && rows . length > 0 ? rows [ 0 ] : rows ) . toMatchObject ( {
177179 AlbumId : 1 ,
178180 Bytes : 11170334 ,
179181 Composer : 'Angus Young, Malcolm Young, Brian Johnson' ,
0 commit comments