Skip to content

Commit

Permalink
Lint test files
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbj committed Jan 22, 2020
1 parent b947326 commit 0800b3c
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
1 change: 0 additions & 1 deletion test/blobDMLBindAsBuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ var should = require('should');
var async = require('async');
var dbConfig = require('./dbconfig.js');
var random = require('./random.js');
var fs = require('fs');
var assist = require('./dataTypeAssist.js');

describe('82.blobDMLBindAsBuffer.js', function() {
Expand Down
1 change: 0 additions & 1 deletion test/clobDMLBindAsString.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
var oracledb = require('oracledb');
var should = require('should');
var async = require('async');
var fs = require('fs');
var dbConfig = require('./dbconfig.js');
var random = require('./random.js');

Expand Down
4 changes: 2 additions & 2 deletions test/cqn01.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe('224. cqn01.js', function() {
eventEmitter.on("received", function() {
console.log("Received message!");
clearTimeout(timeout);
resolve()
resolve();
});
});

Expand Down Expand Up @@ -206,7 +206,7 @@ describe('224. cqn01.js', function() {
eventEmitter.on("received", function() {
console.log("Received message!");
clearTimeout(timeout);
resolve()
resolve();
});
});

Expand Down
4 changes: 2 additions & 2 deletions test/dbType01.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('226. dbType01.js', function() {
const default_stmtCacheSize = oracledb.stmtCacheSize;

before(async () => {
oracledb.stmtCacheSize = 0;
oracledb.stmtCacheSize = 0;
try {
conn = await oracledb.getConnection(dbconfig);
} catch (err) {
Expand Down Expand Up @@ -147,7 +147,7 @@ describe('226. dbType01.js', function() {

it('226.9 DB_TYPE_NUMBER', async () => {
try {
const sql = `SELECT DUMP(:1) FROM dual`;
const sql = `SELECT DUMP(:1) FROM dual`;
const result = await conn.execute(sql,
[{ val: numInVal, type: oracledb.DB_TYPE_NUMBER }]);
(result.rows[0][0]).should.startWith('Typ=2 Len=2');
Expand Down
7 changes: 7 additions & 0 deletions test/list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,13 @@ Overview of node-oracledb functional tests
72.2.4 Negative - not providing first parameter
72.2.5 promise test of createLob()
72.2.6 call lob.close() multiple times sequentially
72.3 NCLOB
72.3.1 BIND_IN, DML, a txt file
72.3.2 BIND_IN, PL/SQL, a txt file
72.3.3 Negative - invalid type
72.3.4 Negative - invalid value
72.3.5 DML - UPDATE statement
72.3.6 BIND_INOUT, PL/SQL, IN LOB gets closed automatically

73. poolPing.js
73.1 the default value of poolPingInterval is 60
Expand Down
12 changes: 9 additions & 3 deletions test/lobBind2.js
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,7 @@ describe("72. lobBind2.js", function() {

lob.on("error", function(err) {
should.not.exist(err, "lob.on 'error' event.");
reject(err);
});

lob.on("end", function() {
Expand Down Expand Up @@ -982,13 +983,14 @@ describe("72. lobBind2.js", function() {

lob.on("error", function(err) {
should.not.exist(err, "lob.on 'error' event.");
reject(err);
});

lob.on("finish", async function() {
const sql = `insert into nodb_tab_nclob72 (id, content)
values (:id, :bindvar)`;
const result = await connection.execute(sql,
{ id: seq, bindvar: lob});
{ id: seq, bindvar: lob});
should.strictEqual(result.rowsAffected, 1);
await lob.close();
}); // finish event
Expand Down Expand Up @@ -1035,6 +1037,7 @@ describe("72. lobBind2.js", function() {

lob.on("error", function(err) {
should.not.exist(err, "lob.on 'error' event.");
reject(err);
});

lob.on("finish", async function() {
Expand Down Expand Up @@ -1108,13 +1111,14 @@ describe("72. lobBind2.js", function() {

lob.on("error", function(err) {
should.not.exist(err, "lob.on 'error' event.");
reject(err);
});

lob.on("finish", async function() {
const sql = `update nodb_tab_nclob72 set content = :bindvar
where id = :id`;
const result = await connection.execute(sql,
{ id: seq, bindvar: lob});
{ id: seq, bindvar: lob});
should.strictEqual(result.rowsAffected, 1);
await lob.close();
await connection.commit();
Expand Down Expand Up @@ -1159,14 +1163,15 @@ describe("72. lobBind2.js", function() {

lob.on("error", function(err) {
should.not.exist(err, "lob.on 'error' event.");
reject(err);
});

lob.on("finish", async function() {
const sql = `begin nodb_proc_nclob_inout1(:id, :io); end;`;
const binds = {
id: seq,
io: { type: oracledb.DB_TYPE_NCLOB,
dir: oracledb.BIND_INOUT, val: lob }
dir: oracledb.BIND_INOUT, val: lob }
};
const options = { autoCommit: true };
const result = await connection.execute(sql, binds, options);
Expand All @@ -1183,6 +1188,7 @@ describe("72. lobBind2.js", function() {

lobout.on("error", function(err) {
should.not.exist(err, "lob.on 'error' event.");
reject(err);
});

lobout.on("end", async function() {
Expand Down

0 comments on commit 0800b3c

Please sign in to comment.