idb-connector
Advanced tools
Comparing version 1.1.6 to 1.1.7
# idb-connector changelog | ||
## 1.1.7 | ||
- Fixed the connection failure(#52) with user/password provided | ||
- Updated some test cases | ||
## 1.1.6 | ||
@@ -4,0 +9,0 @@ |
{ | ||
"name": "idb-connector", | ||
"version": "1.1.6", | ||
"version": "1.1.7", | ||
"description": "A Node.js DB2 driver for IBM i", | ||
@@ -5,0 +5,0 @@ "main": "lib/db2a.js", |
const expect = require('chai').expect; | ||
const db2a = require('../lib/db2a'); | ||
const {dbconn} = db2a; | ||
const username = process.env.DBNAME; | ||
const password = process.env.DBPWD; | ||
@@ -34,2 +36,29 @@ // Test connection Class | ||
}); | ||
if(username && password) { | ||
it('disconnects an exsisting connection to the datbase with user/pwd.', () => { | ||
// Test with username/password | ||
let connection = new dbconn(), | ||
result = connection.conn("*LOCAL", username, password); | ||
result = connection.isConnected(); | ||
expect(result).to.be.true; | ||
result = connection.disconn(); | ||
expect(result).to.be.true; | ||
result = connection.isConnected(); | ||
expect(result).to.be.false; | ||
// Test the callback style | ||
connection.conn("*LOCAL", username, password, () => { | ||
result = connection.isConnected(); | ||
expect(result).to.be.true; | ||
result = connection.disconn(); | ||
expect(result).to.be.true; | ||
result = connection.isConnected(); | ||
expect(result).to.be.false; | ||
}); | ||
}); | ||
} | ||
}); | ||
@@ -120,3 +149,3 @@ | ||
expect(result).to.equal(null); | ||
} catch (e) { console.error(e); } | ||
} catch (e) { } | ||
}); | ||
@@ -123,0 +152,0 @@ }); |
@@ -6,2 +6,3 @@ # How to Test | ||
For example when inside the test directory you can run `npm test connectionTest`. | ||
All Tests can be run by `npm test`. | ||
All Tests can be run by `npm test`. | ||
Test connection with user name & password by `DBNAME=yourname DBPWD=password npm test`. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2145896
35447
152