Skip to content

Commit 4b62dd4

Browse files
Add null checks
1 parent 1968506 commit 4b62dd4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/connection.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ describe('connection', () => {
234234

235235
it('should test rowset', done => {
236236
chinook.sendCommands('TEST ROWSET', (error, results) => {
237+
expect(error).toBeNull()
237238
expect(results.numberOfRows).toBe(41)
238239
expect(results.numberOfColumns).toBe(2)
239240
expect(results.version == 1 || results.version == 2).toBeTruthy()
@@ -246,6 +247,7 @@ describe('connection', () => {
246247
'should test chunked rowset',
247248
done => {
248249
chinook.sendCommands('TEST ROWSET_CHUNK', (error, results) => {
250+
expect(error).toBeNull()
249251
expect(results.numberOfRows).toBe(147)
250252
expect(results.numberOfColumns).toBe(1)
251253
expect(results.columnsNames).toEqual(['key'])
@@ -281,6 +283,7 @@ describe('connection', () => {
281283
describe('send select commands', () => {
282284
it('should select long formatted string', done => {
283285
chinook.sendCommands("USE DATABASE :memory:; select printf('%.*c', 1000, 'x') AS DDD", (error, results) => {
286+
expect(error).toBeNull()
284287
expect(results.numberOfColumns).toBe(1)
285288
expect(results.numberOfRows).toBe(1)
286289
expect(results.version == 1 || results.version == 2).toBeTruthy()
@@ -295,6 +298,7 @@ describe('connection', () => {
295298

296299
it('should select database', done => {
297300
chinook.sendCommands('USE DATABASE chinook.db;', (error, results) => {
301+
expect(error).toBeNull()
298302
expect(results.numberOfColumns).toBeUndefined()
299303
expect(results.numberOfRows).toBeUndefined()
300304
expect(results.version).toBeUndefined()
@@ -304,6 +308,7 @@ describe('connection', () => {
304308

305309
it('should select * from tracks limit 10 (no chunks)', done => {
306310
chinook.sendCommands('SELECT * FROM tracks LIMIT 10;', (error, results) => {
311+
expect(error).toBeNull()
307312
expect(results.numberOfColumns).toBe(9)
308313
expect(results.numberOfRows).toBe(10)
309314
done()
@@ -312,6 +317,7 @@ describe('connection', () => {
312317

313318
it('should select * from tracks (with chunks)', done => {
314319
chinook.sendCommands('SELECT * FROM tracks;', (error, results) => {
320+
expect(error).toBeNull()
315321
expect(results.numberOfColumns).toBe(9)
316322
expect(results.numberOfRows).toBe(3503)
317323
done()
@@ -320,6 +326,7 @@ describe('connection', () => {
320326

321327
it('should select * from albums', done => {
322328
chinook.sendCommands('SELECT * FROM albums;', (error, results) => {
329+
expect(error).toBeNull()
323330
expect(results.numberOfColumns).toBe(3)
324331
expect(results.numberOfRows).toBe(347)
325332
expect(results.version == 1 || results.version == 2).toBeTruthy()

0 commit comments

Comments
 (0)