Make Ssl tests opt-in
This commit is contained in:
parent
bc2fbe14e3
commit
34e8262dc8
11
.idea/codeStyles/Project.xml
Normal file
11
.idea/codeStyles/Project.xml
Normal file
|
@ -0,0 +1,11 @@
|
|||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<codeStyleSettings language="JavaScript">
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
||||
<option name="TAB_SIZE" value="2" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</state>
|
||||
</component>
|
|
@ -3,16 +3,18 @@ var GossipSeed = require('../src/gossipSeed');
|
|||
|
||||
var testBase = require('./common/base_test');
|
||||
|
||||
var withSsl = !!process.env.NODE_ESC_WITH_SSL;
|
||||
|
||||
module.exports = {
|
||||
'Connect To Endpoint Happy Path': function(test) {
|
||||
'Connect To Endpoint Happy Path': function (test) {
|
||||
test.expect(1);
|
||||
var tcpEndpoint = {host: 'localhost', port: 1113};
|
||||
var conn = client.EventStoreConnection.create(testBase.settings(), tcpEndpoint);
|
||||
conn.connect()
|
||||
.catch(function(err) {
|
||||
test.done(err);
|
||||
});
|
||||
conn.on('connected', function(endPoint){
|
||||
.catch(function (err) {
|
||||
test.done(err);
|
||||
});
|
||||
conn.on('connected', function (endPoint) {
|
||||
test.areEqual("connected endPoint", endPoint, tcpEndpoint);
|
||||
done();
|
||||
});
|
||||
|
@ -24,14 +26,14 @@ module.exports = {
|
|||
test.done();
|
||||
}
|
||||
},
|
||||
'Connect To Endpoint That Doesn\'t Exist': function(test) {
|
||||
'Connect To Endpoint That Doesn\'t Exist': function (test) {
|
||||
test.expect(1);
|
||||
var tcpEndpoint = {host: 'localhost', port: 11112};
|
||||
var conn = client.EventStoreConnection.create(testBase.settings({maxReconnections:1}), tcpEndpoint);
|
||||
var conn = client.EventStoreConnection.create(testBase.settings({maxReconnections: 1}), tcpEndpoint);
|
||||
conn.connect()
|
||||
.catch(function (err) {
|
||||
test.done(err);
|
||||
});
|
||||
.catch(function (err) {
|
||||
test.done(err);
|
||||
});
|
||||
conn.on('connected', function () {
|
||||
test.ok(false, "Should not be able to connect.");
|
||||
test.done();
|
||||
|
@ -39,12 +41,12 @@ module.exports = {
|
|||
conn.on('error', function (err) {
|
||||
test.done(err);
|
||||
});
|
||||
conn.on('closed', function(reason) {
|
||||
conn.on('closed', function (reason) {
|
||||
test.ok(reason.indexOf("Reconnection limit reached") === 0, "Wrong expected reason.");
|
||||
test.done();
|
||||
});
|
||||
},
|
||||
'Create a connection with tcp://host:port string': function(test) {
|
||||
'Create a connection with tcp://host:port string': function (test) {
|
||||
var conn = client.createConnection({}, 'tcp://localhost:1113');
|
||||
conn.close();
|
||||
test.done();
|
||||
|
@ -72,8 +74,11 @@ module.exports = {
|
|||
if (err) return test.done(err);
|
||||
test.done();
|
||||
}
|
||||
}*/,
|
||||
'Connect to secure tcp endpoint': function(test) {
|
||||
}*/
|
||||
};
|
||||
|
||||
if (withSsl) {
|
||||
module.exports['Connect to secure tcp endpoint'] = function(test) {
|
||||
var conn = client.createConnection({
|
||||
useSslConnection: true,
|
||||
targetHost: 'localhost',
|
||||
|
@ -90,6 +95,6 @@ module.exports = {
|
|||
test.done();
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
testBase.init(module.exports, false);
|
Loading…
Reference in New Issue
Block a user