Comparing version 0.0.18 to 0.0.19
@@ -17,2 +17,3 @@ /* | ||
module.exports.Logger = require('./lib/logger.js'); | ||
module.exports.ConfigNormalizer = require('./lib/config/configNormalizer.js'); | ||
module.exports.ConfigNormalizer = require('./lib/config/configNormalizer.js'); | ||
module.exports.Middleware = require('./lib/middleware.js'); |
@@ -22,3 +22,2 @@ /* | ||
/** | ||
@@ -101,9 +100,10 @@ * global config | ||
expect(iconv.encodingExists(serviceInfo.encoding), info('encoding is valid')).to.be.true; | ||
//TODO use registered converter to check | ||
should(serviceInfo, 'pack').to.be.a('string'); | ||
expect(RalModule.modules.converter).to.have.property(serviceInfo.pack); | ||
should(serviceInfo, 'unpack').to.be.a('string'); | ||
//TODO use registered balance to check | ||
expect(RalModule.modules.converter).to.have.property(serviceInfo.unpack); | ||
should(serviceInfo, 'balance').to.be.a('string'); | ||
//TODO use registered protocol to check | ||
expect(RalModule.modules.balance).to.have.property(serviceInfo.balance); | ||
should(serviceInfo, 'protocol').to.be.a('string'); | ||
expect(RalModule.modules.protocol).to.have.property(serviceInfo.protocol); | ||
should(serviceInfo, 'hybird').to.be.a('boolean'); | ||
@@ -110,0 +110,0 @@ should(serviceInfo, 'server').to.be.a('array').and.not.to.be.empty; |
{ | ||
"name": "node-ral", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "a rpc client for node", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -34,7 +34,7 @@ /* | ||
timeout : 500, | ||
pack : 'mcpack', | ||
unpack : 'mcpack', | ||
pack : 'form', | ||
unpack : 'json', | ||
encoding : 'GBK', | ||
balance : 'random', | ||
protocol : 'nshead', | ||
protocol : 'http', | ||
server : [ | ||
@@ -41,0 +41,0 @@ { host : 'st.yd.baidu.com', port : 80, idc : 'st'} |
@@ -58,7 +58,7 @@ /* | ||
timeout : 500, | ||
pack : 'mcpack', | ||
unpack : 'mcpack', | ||
pack : 'form', | ||
unpack : 'json', | ||
encoding : 'GBK', | ||
balance : 'random', | ||
protocol : 'nshead', | ||
protocol : 'http', | ||
server : [ | ||
@@ -65,0 +65,0 @@ { host : 'st.yd.baidu.com', port : 80, idc : 'st'} |
@@ -58,7 +58,7 @@ /* | ||
timeout : 500, | ||
pack : 'mcpack', | ||
unpack : 'mcpack', | ||
pack : 'form', | ||
unpack : 'json', | ||
encoding : 'GBK', | ||
balance : 'random', | ||
protocol : 'nshead', | ||
protocol : 'http', | ||
server : [ | ||
@@ -65,0 +65,0 @@ { host : 'st.yd.baidu.com', port : 80, idc : 'st'} |
@@ -243,2 +243,16 @@ /* | ||
}); | ||
it('should caught error when server failed', function (done) { | ||
before(function( ok ){ | ||
isInited.on('done', ok); | ||
}); | ||
var req = RAL('GET_QS_SERV', { | ||
path: '/close', | ||
timeout:200 | ||
}); | ||
req.on('error', function(error){ | ||
error.toString().should.be.match(/request time out/); | ||
done(); | ||
}); | ||
}); | ||
}); |
@@ -55,2 +55,4 @@ /* | ||
response.end(); | ||
}else if (pathname === '/close'){ | ||
this.close(); | ||
}else{ | ||
@@ -57,0 +59,0 @@ response.writeHead(200, { |
253039
59
6867