Skip to content

Commit db4c7ea

Browse files
committed
Test updates
1 parent d433c3d commit db4c7ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2045
-1310
lines changed

test/autoCommitForSelect.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ describe('8. autoCommitForSelect.js', function(){
137137

138138
afterEach(function(done){
139139
connection.execute(
140-
'DROP TABLE nodb_commit4_dept purge',
141-
function(err){
142-
if(err) { console.error(err.message); return; }
143-
done();
144-
}
145-
);
140+
'DROP TABLE nodb_commit4_dept purge',
141+
function(err){
142+
if(err) { console.error(err.message); return; }
143+
done();
144+
}
145+
);
146146
});
147147

148148
it('8.1 should return previous value when autoCommit is false', function(done){

test/bindTimestamp.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ describe('102. bindTimestamp.js', function() {
257257
connection.execute(
258258
"insert into nodb_tab_tsbind values (:1, :2, :3) returning id, tstz into :4, :5",
259259
[id, bv, bv, { type: oracledb.NUMBER, dir: oracledb.BIND_OUT},
260-
{ type: oracledb.DATE, dir: oracledb.BIND_OUT} ],
260+
{ type: oracledb.DATE, dir: oracledb.BIND_OUT} ],
261261
{ autoCommit: true},
262262
function(err, result) {
263263
should.not.exist(err);
@@ -330,7 +330,7 @@ describe('102. bindTimestamp.js', function() {
330330
connection.execute(
331331
"insert into nodb_tab_tsbind values (:1, :2, :3) returning id, tstz into :4, :5",
332332
[id, bv, bv, { type: oracledb.NUMBER, dir: oracledb.BIND_OUT},
333-
{ type: oracledb.NUMBER, dir: oracledb.BIND_OUT} ],
333+
{ type: oracledb.NUMBER, dir: oracledb.BIND_OUT} ],
334334
{ autoCommit: true},
335335
function(err) {
336336
should.exist(err);

test/binding.js

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -676,15 +676,15 @@ describe('4. binding.js', function() {
676676
it('4.4.3 Negative - bind out data exceeds default length', function(done) {
677677
connection.execute(
678678
"BEGIN :o := lpad('A',201,'x'); END;",
679-
{ o: { type: oracledb.STRING, dir : oracledb.BIND_OUT } },
680-
function (err, result) {
681-
should.exist(err);
682-
// ORA-06502: PL/SQL: numeric or value error
683-
err.message.should.startWith('ORA-06502:');
684-
// console.log(result.outBinds.o.length);
685-
should.not.exist(result);
686-
done();
687-
}
679+
{ o: { type: oracledb.STRING, dir : oracledb.BIND_OUT } },
680+
function (err, result) {
681+
should.exist(err);
682+
// ORA-06502: PL/SQL: numeric or value error
683+
err.message.should.startWith('ORA-06502:');
684+
// console.log(result.outBinds.o.length);
685+
should.not.exist(result);
686+
done();
687+
}
688688
);
689689
});
690690

@@ -805,67 +805,67 @@ describe('4. binding.js', function() {
805805
// Test cases involving JSON value as input
806806
describe ('4.7 Value as JSON named/unamed test cases', function () {
807807
it ( '4.7.1 valid case when numeric values are passed as it is',
808-
function (done ) {
809-
var sql = "SELECT SYSDATE FROM DUAL WHERE :b = 1 and :c = 456 ";
810-
var binds = [ 1, 456 ];
811-
812-
oracledb.getConnection (
813-
dbConfig,
814-
function (err, connection ){
815-
816-
should.not.exist ( err ) ;
817-
connection.execute (
818-
sql,
819-
binds,
820-
function ( err, result ) {
821-
(result.rows[0][0]).should.be.a.Date();
822-
should.not.exist ( err );
823-
done ();
824-
}
825-
);
826-
});
827-
});
808+
function (done ) {
809+
var sql = "SELECT SYSDATE FROM DUAL WHERE :b = 1 and :c = 456 ";
810+
var binds = [ 1, 456 ];
811+
812+
oracledb.getConnection (
813+
dbConfig,
814+
function (err, connection ){
815+
816+
should.not.exist ( err ) ;
817+
connection.execute (
818+
sql,
819+
binds,
820+
function ( err, result ) {
821+
(result.rows[0][0]).should.be.a.Date();
822+
should.not.exist ( err );
823+
done ();
824+
}
825+
);
826+
});
827+
});
828828

829829
it ( '4.7.2 Valid values when one of the value is passed as JSON ',
830-
function (done ) {
831-
var sql = "SELECT SYSDATE FROM DUAL WHERE :b = 1 and :c = 456 ";
832-
var binds = [ 1, { val : 456 } ];
833-
834-
oracledb.getConnection (
835-
dbConfig,
836-
function (err, connection ){
837-
838-
should.not.exist ( err ) ;
839-
connection.execute (
840-
sql,
841-
binds,
842-
function ( err, result ) {
843-
(result.rows[0][0]).should.be.a.Date();
844-
should.not.exist ( err );
845-
done ();
846-
} );
847-
});
848-
});
830+
function (done ) {
831+
var sql = "SELECT SYSDATE FROM DUAL WHERE :b = 1 and :c = 456 ";
832+
var binds = [ 1, { val : 456 } ];
833+
834+
oracledb.getConnection (
835+
dbConfig,
836+
function (err, connection ){
837+
838+
should.not.exist ( err ) ;
839+
connection.execute (
840+
sql,
841+
binds,
842+
function ( err, result ) {
843+
(result.rows[0][0]).should.be.a.Date();
844+
should.not.exist ( err );
845+
done ();
846+
} );
847+
});
848+
});
849849

850850
it ( '4.7.3 Valid test case when one of the value is passed as JSON ',
851851
function (done ) {
852852
var sql = "SELECT SYSDATE FROM DUAL WHERE :b = 1 and :c = 456 ";
853853
var binds = [ {val : 1}, 456 ];
854854

855855
oracledb.getConnection (
856-
dbConfig,
857-
function (err, connection ){
858-
859-
should.not.exist ( err ) ;
860-
connection.execute (
861-
sql,
862-
binds,
863-
function ( err, result ) {
864-
(result.rows[0][0]).should.be.a.Date();
865-
should.not.exist ( err );
866-
done ();
867-
} );
868-
});
856+
dbConfig,
857+
function (err, connection ){
858+
859+
should.not.exist ( err ) ;
860+
connection.execute (
861+
sql,
862+
binds,
863+
function ( err, result ) {
864+
(result.rows[0][0]).should.be.a.Date();
865+
should.not.exist ( err );
866+
done ();
867+
} );
868+
});
869869
});
870870

871871
it ( '4.7.4 Valid Test case when both values are passed as JSON',
@@ -874,19 +874,19 @@ describe('4. binding.js', function() {
874874
var binds = [ {val : 1}, {val : 456 } ];
875875

876876
oracledb.getConnection (
877-
dbConfig,
878-
function (err, connection ){
879-
880-
should.not.exist ( err ) ;
881-
connection.execute (
882-
sql,
883-
binds,
884-
function ( err, result ) {
885-
(result.rows[0][0]).should.be.a.Date();
886-
should.not.exist ( err );
887-
done ();
888-
} );
889-
});
877+
dbConfig,
878+
function (err, connection ){
879+
880+
should.not.exist ( err ) ;
881+
connection.execute (
882+
sql,
883+
binds,
884+
function ( err, result ) {
885+
(result.rows[0][0]).should.be.a.Date();
886+
should.not.exist ( err );
887+
done ();
888+
} );
889+
});
890890
});
891891

892892
it ( '4.7.5 Invalid Test case when value is passed as named JSON',

0 commit comments

Comments
 (0)