Skip to content

Commit cbd7c29

Browse files
committed
Refactor metadata tests
1 parent a9374f0 commit cbd7c29

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

test/binding.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,7 @@ describe('4. binding.js', function() {
794794
sql,
795795
binds,
796796
function ( err, result ) {
797+
(result.rows[0][0]).should.be.a.Date();
797798
should.not.exist ( err );
798799
done ();
799800
}
@@ -815,6 +816,7 @@ describe('4. binding.js', function() {
815816
sql,
816817
binds,
817818
function ( err, result ) {
819+
(result.rows[0][0]).should.be.a.Date();
818820
should.not.exist ( err );
819821
done ();
820822
} );
@@ -835,6 +837,7 @@ describe('4. binding.js', function() {
835837
sql,
836838
binds,
837839
function ( err, result ) {
840+
(result.rows[0][0]).should.be.a.Date();
838841
should.not.exist ( err );
839842
done ();
840843
} );
@@ -855,6 +858,7 @@ describe('4. binding.js', function() {
855858
sql,
856859
binds,
857860
function ( err, result ) {
861+
(result.rows[0][0]).should.be.a.Date();
858862
should.not.exist ( err );
859863
done ();
860864
} );
@@ -875,7 +879,7 @@ describe('4. binding.js', function() {
875879
binds,
876880
function ( err, result ) {
877881
should.exist ( err );
878-
(err.message).should.startWith ( 'NJS-044');
882+
(err.message).should.startWith ( 'NJS-044:');
879883
done ();
880884
} );
881885
});
@@ -895,7 +899,7 @@ describe('4. binding.js', function() {
895899
binds,
896900
function ( err, result ) {
897901
should.exist ( err );
898-
(err.message).should.startWith ( 'NJS-044');
902+
(err.message).should.startWith ( 'NJS-044:');
899903
done ();
900904
} );
901905
});
@@ -915,10 +919,10 @@ describe('4. binding.js', function() {
915919
binds,
916920
function ( err, result ) {
917921
should.exist ( err );
918-
(err.message).should.startWith ( 'NJS-044');
922+
(err.message).should.startWith ( 'NJS-044:');
919923
done ();
920924
} );
921925
});
922-
});
923-
});
926+
}); // 4.7.7
927+
}); // 4.7
924928
})

test/extendedMetaData.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,6 +1455,7 @@ describe('17. extendedMetaData.js', function() {
14551455
[],
14561456
{ outFormat: oracledb.OBJECT, extendedMetaData: true },
14571457
function(err, result) {
1458+
oracledb.fetchAsString = [];
14581459
should.not.exist(err);
14591460
(result.rows[0]).DT.should.be.a.String();
14601461
(result.rows[0]).NUM.should.be.a.String();
@@ -1475,13 +1476,13 @@ describe('17. extendedMetaData.js', function() {
14751476
cb();
14761477
}
14771478
);
1479+
},
1480+
function(cb) {
1481+
var defaultValue = [];
1482+
(oracledb.fetchAsString).should.eql(defaultValue);
1483+
cb();
14781484
}
1479-
], function(err) {
1480-
should.not.exist(err);
1481-
var defaultValue = [];
1482-
oracledb.fetchAsString = defaultValue;
1483-
done();
1484-
});
1485+
], done);
14851486

14861487
}); // 17.6.2
14871488

@@ -1498,6 +1499,7 @@ describe('17. extendedMetaData.js', function() {
14981499
[],
14991500
{ outFormat: oracledb.OBJECT, extendedMetaData: true },
15001501
function(err, result) {
1502+
oracledb.fetchAsString = [];
15011503
should.not.exist(err);
15021504
(result.rows[0]).DT.should.be.a.String();
15031505
(result.rows[0]).NUM.should.be.a.String();
@@ -1518,12 +1520,13 @@ describe('17. extendedMetaData.js', function() {
15181520
cb();
15191521
}
15201522
);
1523+
},
1524+
function(cb) {
1525+
var defaultValue = [];
1526+
(oracledb.fetchAsString).should.eql(defaultValue);
1527+
cb();
15211528
}
1522-
], function(err) {
1523-
var defaultValue = [];
1524-
oracledb.fetchAsString = defaultValue;
1525-
done();
1526-
});
1529+
], done);
15271530

15281531
}); // 17.6.3
15291532

0 commit comments

Comments
 (0)