{"size": 1029, "ext": "js", "max_stars_repo_path": "test/spec.js", "max_stars_repo_name": "toberoo/promise-oracledb", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/spec.js", "max_issues_repo_name": "toberoo/promise-oracledb", "max_issues_repo_issues_event_min_datetime": "2016-03-28T15:36:46.000Z", "max_issues_repo_issues_event_max_datetime": "2016-06-01T20:31:04.000Z", "max_forks_repo_path": "test/spec.js", "max_forks_repo_name": "toberoo/promise-oracledb", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 8, "max_forks_count": null, "avg_line_length": 23.3863636364, "max_line_length": 73, "alphanum_fraction": 0.612244898}
var assert = require('assert');
var db = require(__dirname +'/../index.js');

describe('Test Promise Oracle Database', function() {
	/* Redacted, confidential information, come up with a way for others to
	   test without revealing database information.
	*/

	it ('Query1', function(done) {
		this.timeout(12000);
		db.setConnection({
			user: process.env.DB_QC_USERNAME,
			password: process.env.DB_QA_PASSWORD,
			connectString: process.env.DB_QC_CONNECT_STRING,
			enableLogging: true
		});
		db.createQuery({
			query: 'SELECT * FROM DUAL'
		})
		.execute()
		.then(function(result) {
			done();
		});
	});

	it ('Query2', function(done) {
		this.timeout(12000);
		db.createQuery({
			query: 'SELECT * FROM DUAL'
		})
		.execute()
		.then(function(result) {
			assert.equal(result.rows[0], 'X');
			//Close database
			db.close().then(function(result) {
				//console.log(result);
				done();
			}, function(err) {
				assert.equal(err, undefined);
				done();
			});
		});
	});
});