Skip to content

Commit

Permalink
added https connection test
Browse files Browse the repository at this point in the history
  • Loading branch information
janza committed May 5, 2015
1 parent d6c82da commit b98116e
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,4 +430,38 @@ describe('Helpers', function () {
{time: 1383934015205, sequence_number: 23168, value: 232}
]);
});
});
});

describe('HTTPS connection', function() {
var client;

var dbName = 'https_db';

describe('connect and create test DB', function () {

before(function() {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; // allow self-signed cert

client = influx({
host: 'localhost',
port: 8084,
protocol: 'https',
username: 'root',
password: 'root',
timePrecision: 'ms'
});
});

it('should create a new database without error', function (done) {
client.createDatabase(dbName, done);
});

it('should throw an error if db already exists', function (done) {
client.createDatabase(dbName, function (err) {
assert(err instanceof Error);
done();
});
});

});
});

0 comments on commit b98116e

Please sign in to comment.