@@ -142,10 +142,11 @@ describe('Database.all', () => {
142
142
'select with one argument' ,
143
143
done => {
144
144
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 ) => {
146
146
expect ( err ) . toBeNull ( )
147
147
expect ( rows ) . toBeDefined ( )
148
- expect ( rows [ 0 ] ) . toMatchObject ( {
148
+ expect ( rows ) . toHaveLength ( 1 )
149
+ expect ( rows && rows . length > 0 ? rows [ 0 ] : rows ) . toMatchObject ( {
149
150
AlbumId : 1 ,
150
151
Bytes : 11170334 ,
151
152
Composer : 'Angus Young, Malcolm Young, Brian Johnson' ,
@@ -170,10 +171,11 @@ describe('Database.all', () => {
170
171
'select with one argument with array like ORMs' ,
171
172
done => {
172
173
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 ) => {
174
175
expect ( err ) . toBeNull ( )
175
176
expect ( rows ) . toBeDefined ( )
176
- expect ( rows [ 0 ] ) . toMatchObject ( {
177
+ expect ( rows ) . toHaveLength ( 1 )
178
+ expect ( rows && rows . length > 0 ? rows [ 0 ] : rows ) . toMatchObject ( {
177
179
AlbumId : 1 ,
178
180
Bytes : 11170334 ,
179
181
Composer : 'Angus Young, Malcolm Young, Brian Johnson' ,
0 commit comments