Skip to content

Commit 7ca0510

Browse files
committed
Update test assertion syntax
1 parent 59391fb commit 7ca0510

29 files changed

+200
-200
lines changed

test/accessTerminatedPoolAttributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('51. accessTerminatedPoolAttributes.js', function(){
5151
},
5252
function(err, pool){
5353
should.not.exist(err);
54-
pool.should.be.ok;
54+
pool.should.be.ok();
5555
if(dbConfig.externalAuth){
5656
pool.connectionsOpen.should.be.exactly(0);
5757
} else {

test/autoCommit.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ describe('7. autoCommit.js', function() {
180180
{ outFormat: oracledb.OBJECT },
181181
function(err, result) {
182182
should.not.exist(err);
183-
result.rows[0].DEPARTMENT_ID.should.eql(82).and.be.a.Number;
183+
result.rows[0].DEPARTMENT_ID.should.eql(82).and.be.a.Number();
184184
callback();
185185
}
186186
);
@@ -201,7 +201,7 @@ describe('7. autoCommit.js', function() {
201201
{ outFormat: oracledb.OBJECT },
202202
function(err, result) {
203203
should.not.exist(err);
204-
result.rows[0].DEPARTMENT_ID.should.eql(101).and.be.a.Number;
204+
result.rows[0].DEPARTMENT_ID.should.eql(101).and.be.a.Number();
205205
callback();
206206
}
207207
);
@@ -261,7 +261,7 @@ describe('7. autoCommit.js', function() {
261261
{ outFormat: oracledb.OBJECT },
262262
function(err, result) {
263263
should.not.exist(err);
264-
result.rows[0].DEPARTMENT_ID.should.eql(82).and.be.a.Number;
264+
result.rows[0].DEPARTMENT_ID.should.eql(82).and.be.a.Number();
265265
callback();
266266
}
267267
);
@@ -282,7 +282,7 @@ describe('7. autoCommit.js', function() {
282282
{ outFormat: oracledb.OBJECT },
283283
function(err, result) {
284284
should.not.exist(err);
285-
result.rows[0].DEPARTMENT_ID.should.eql(101).and.be.a.Number;
285+
result.rows[0].DEPARTMENT_ID.should.eql(101).and.be.a.Number();
286286
callback();
287287
}
288288
);

test/autoCommitForSelect.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe('8. autoCommitForSelect.js', function(){
131131
})
132132

133133
it('8.1 should return previous value when autoCommit is false', function(done){
134-
connection.should.be.ok;
134+
connection.should.be.ok();
135135
oracledb.autoCommit = false;
136136

137137
async.series([
@@ -197,7 +197,7 @@ describe('8. autoCommitForSelect.js', function(){
197197
})
198198

199199
it('8.2 can use explicit commit() to keep data consistent', function(done){
200-
connection.should.be.ok;
200+
connection.should.be.ok();
201201
oracledb.autoCommit = false;
202202

203203
async.series([
@@ -269,7 +269,7 @@ describe('8. autoCommitForSelect.js', function(){
269269
})
270270

271271
it('8.3 can also use the autoCommit for SELECTs feature', function(done){
272-
connection.should.be.ok;
272+
connection.should.be.ok();
273273
oracledb.autoCommit = false;
274274

275275
async.series([

test/binding.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe('4. binding.js', function() {
6969
BEGIN \
7070
p_out := 'abcdef'; \
7171
END;";
72-
connection.should.be.ok;
72+
connection.should.be.ok();
7373
connection.execute(
7474
proc,
7575
function(err) {
@@ -126,7 +126,7 @@ describe('4. binding.js', function() {
126126
BEGIN \
127127
p_out := 10010; \
128128
END;";
129-
connection.should.be.ok;
129+
connection.should.be.ok();
130130
connection.execute(
131131
proc,
132132
function(err) {
@@ -184,7 +184,7 @@ describe('4. binding.js', function() {
184184
p_inout := p_in || ' ' || p_inout; \
185185
p_out := 101; \
186186
END; ";
187-
connection.should.be.ok;
187+
connection.should.be.ok();
188188
connection.execute(
189189
proc,
190190
function(err) {
@@ -246,7 +246,7 @@ describe('4. binding.js', function() {
246246
p_inout := p_in || ' ' || p_inout; \
247247
p_out := 101; \
248248
END; ";
249-
connection.should.be.ok;
249+
connection.should.be.ok();
250250
connection.execute(
251251
proc,
252252
function(err) {
@@ -300,7 +300,7 @@ describe('4. binding.js', function() {
300300
})
301301

302302
it('4.1.5 default bind type - STRING', function(done) {
303-
connection.should.be.ok;
303+
connection.should.be.ok();
304304
var sql = "begin :n := 1001; end;";
305305
var bindVar = { n : { dir: oracledb.BIND_OUT } };
306306
var options = { };
@@ -361,7 +361,7 @@ describe('4. binding.js', function() {
361361
})
362362

363363
afterEach(function(done) {
364-
connection.should.be.ok;
364+
connection.should.be.ok();
365365
connection.execute(
366366
"DROP TABLE nodb_binding",
367367
function(err) {
@@ -462,7 +462,7 @@ describe('4. binding.js', function() {
462462
})
463463

464464
afterEach(function(done) {
465-
connection.should.be.ok;
465+
connection.should.be.ok();
466466
connection.execute(
467467
"DROP TABLE nodb_binding",
468468
function(err) {
@@ -605,7 +605,7 @@ describe('4. binding.js', function() {
605605
BEGIN \
606606
p_out := 'ABCDEF GHIJK LMNOP QRSTU'; \
607607
END;";
608-
connection.should.be.ok;
608+
connection.should.be.ok();
609609
connection.execute(
610610
proc,
611611
function(err) {

test/columnMetadata.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ describe('9. columnMetadata.js', function(){
179179
function(err, result){
180180
should.not.exist(err);
181181
result.rows[0][0].should.be.exactly(3);
182-
result.metaData.should.be.ok;
182+
result.metaData.should.be.ok();
183183
result.metaData[0].name.should.eql('COUNT(*)');
184184
done();
185185
}
@@ -217,7 +217,7 @@ describe('9. columnMetadata.js', function(){
217217
[99],
218218
function(err, result){
219219
should.not.exist(err);
220-
result.metaData.should.be.ok;
220+
result.metaData.should.be.ok();
221221
result.metaData.length.should.be.exactly(4);
222222
result.metaData[0].name.should.eql('DEPARTMENT_ID');
223223
result.metaData[1].name.should.eql('DEPARTMENT_NAME');
@@ -246,7 +246,7 @@ describe('9. columnMetadata.js', function(){
246246
[40],
247247
function(err, result){
248248
should.not.exist(err);
249-
result.metaData.should.be.ok;
249+
result.metaData.should.be.ok();
250250
result.metaData[0].name.should.eql('DEPARTMENT_NAME');
251251
result.rows[0][0].should.eql('Finance');
252252
done();

test/connection.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe('1. connection.js', function(){
104104
var defaultFormat = oracledb.outFormat;
105105
defaultFormat.should.be.exactly(oracledb.ARRAY);
106106

107-
connection.should.be.ok;
107+
connection.should.be.ok();
108108
connection.execute(query, [40], function(err, result){
109109
should.not.exist(err);
110110
(result.rows).should.eql([[ 40, 'Human Resources' ]]);
@@ -113,7 +113,7 @@ describe('1. connection.js', function(){
113113
})
114114

115115
it('1.1.2 ARRAY format explicitly', function(done) {
116-
connection.should.be.ok;
116+
connection.should.be.ok();
117117
connection.execute(
118118
query, {id: 20}, {outFormat: oracledb.ARRAY},
119119
function(err, result){
@@ -125,7 +125,7 @@ describe('1. connection.js', function(){
125125
})
126126

127127
it('1.1.3 OBJECT format', function(done){
128-
connection.should.be.ok;
128+
connection.should.be.ok();
129129
connection.execute(
130130
query, {id: 20}, {outFormat: oracledb.OBJECT},
131131
function(err, result){
@@ -137,7 +137,7 @@ describe('1. connection.js', function(){
137137
})
138138

139139
it('1.1.4 Negative test - invalid outFormat value', function(done){
140-
connection.should.be.ok;
140+
connection.should.be.ok();
141141
connection.execute(
142142
query, {id: 20}, {outFormat:0 },
143143
function(err, result){
@@ -216,7 +216,7 @@ describe('1. connection.js', function(){
216216
var defaultLimit = oracledb.maxRows;
217217
defaultLimit.should.be.exactly(100);
218218

219-
connection.should.be.ok;
219+
connection.should.be.ok();
220220
connection.execute(
221221
"SELECT * FROM nodb_employees ORDER BY employee_id",
222222
function(err, result){
@@ -230,7 +230,7 @@ describe('1. connection.js', function(){
230230
})
231231

232232
it('1.2.2 can also specify for each execution', function(done){
233-
connection.should.be.ok;
233+
connection.should.be.ok();
234234
connection.execute(
235235
"SELECT * FROM nodb_employees ORDER BY employee_id",
236236
{}, { maxRows: 25 },
@@ -245,7 +245,7 @@ describe('1. connection.js', function(){
245245
})
246246

247247
it('1.2.3 can not set maxRows to be 0', function(done){
248-
connection.should.be.ok;
248+
connection.should.be.ok();
249249
connection.execute(
250250
"SELECT * FROM nodb_employees ORDER BY employee_id",
251251
{}, { maxRows: 0 },
@@ -259,7 +259,7 @@ describe('1. connection.js', function(){
259259
})
260260

261261
it('1.2.4 cannot set maxRows to be a negative number', function(done){
262-
connection.should.be.ok;
262+
connection.should.be.ok();
263263
connection.execute(
264264
"SELECT * FROM nodb_employees ORDER BY employee_id",
265265
{}, {maxRows: -5},
@@ -285,7 +285,7 @@ describe('1. connection.js', function(){
285285
})
286286

287287
it('1.2.6 shows 12c new way to limit the number of records fetched by queries', function(done) {
288-
connection.should.be.ok;
288+
connection.should.be.ok();
289289

290290
var myoffset = 2; // number of rows to skip
291291
var mymaxnumrows = 6; // number of rows to fetch
@@ -353,7 +353,7 @@ describe('1. connection.js', function(){
353353
io: { val: 'Turing', type: oracledb.STRING, dir: oracledb.BIND_INOUT },
354354
o: { type: oracledb.STRING, dir: oracledb.BIND_OUT }
355355
};
356-
connection.should.be.ok;
356+
connection.should.be.ok();
357357
connection.execute(
358358
"BEGIN nodb_bindingtest(:i, :io, :o); END;",
359359
bindValues,
@@ -434,7 +434,7 @@ describe('1. connection.js', function(){
434434
})
435435

436436
it('1.4.1 stmtCacheSize = 0, which disable statement caching', function(done) {
437-
connection.should.be.ok;
437+
connection.should.be.ok();
438438
oracledb.stmtCacheSize = 0;
439439

440440
async.series([
@@ -475,7 +475,7 @@ describe('1. connection.js', function(){
475475
})
476476

477477
it('1.4.2 works well when statement cache enabled (stmtCacheSize > 0) ', function(done) {
478-
connection.should.be.ok;
478+
connection.should.be.ok();
479479
oracledb.stmtCacheSize = 100;
480480

481481
async.series([
@@ -566,7 +566,7 @@ describe('1. connection.js', function(){
566566
});
567567
},
568568
function(callback) {
569-
conn1.should.be.ok;
569+
conn1.should.be.ok();
570570
conn1.execute(
571571
makeTable,
572572
[],
@@ -581,8 +581,8 @@ describe('1. connection.js', function(){
581581
})
582582

583583
afterEach('drop table and release connections', function(done) {
584-
conn1.should.be.ok;
585-
conn2.should.be.ok;
584+
conn1.should.be.ok();
585+
conn2.should.be.ok();
586586
async.series([
587587
function(callback) {
588588
conn2.execute(

test/dataTypeAssist.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ assist.sqlCreateTable = function(tableName)
481481
/************************* Functions for Verifiction *********************************/
482482

483483
assist.dataTypeSupport = function(connection, tableName, array, done) {
484-
connection.should.be.ok;
484+
connection.should.be.ok();
485485
connection.execute(
486486
"SELECT * FROM " + tableName + " ORDER BY num",
487487
[],
@@ -615,7 +615,7 @@ assist.verifyNullValues = function(connection, tableName, done)
615615
{
616616
var sqlInsert = "INSERT INTO " + tableName + " VALUES(:no, :bindValue)";
617617

618-
connection.should.be.ok;
618+
connection.should.be.ok();
619619
async.series([
620620
function createTable(callback) {
621621
var sqlCreate = assist.sqlCreateTable(tableName);

test/dataTypeBinaryDouble.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ describe('31. dataTypeBinaryDouble.js', function() {
132132

133133
for(var i = 0; i < nums.length; i++) {
134134
result.rows[i].CONTENT.should.not.be.exactly(nums[ result.rows[i].NUM ]);
135-
approxeq(result.rows[i].CONTENT, nums[ result.rows[i].NUM ]).should.be.ok;
135+
approxeq(result.rows[i].CONTENT, nums[ result.rows[i].NUM ]).should.be.ok();
136136
}
137137
done();
138138
}

test/dataTypeBinaryFloat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ describe('30. dataTypeBinaryFloat.js', function() {
130130

131131
for(var i = 0; i < nums.length; i++) {
132132
result.rows[i].CONTENT.should.not.be.exactly(nums[ result.rows[i].NUM ]);
133-
approxeq(result.rows[i].CONTENT, nums[ result.rows[i].NUM ]).should.be.ok;
133+
approxeq(result.rows[i].CONTENT, nums[ result.rows[i].NUM ]).should.be.ok();
134134
}
135135
done();
136136
}

test/dataTypeBlob.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('41. dataTypeBlob', function() {
8585
})
8686

8787
it('41.1.1 stores BLOB value correctly', function(done) {
88-
connection.should.be.ok;
88+
connection.should.be.ok();
8989
async.series([
9090
function blobinsert1(callback) {
9191

0 commit comments

Comments
 (0)