Skip to content

Commit

Permalink
fix thtp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Bennett committed Oct 29, 2015
1 parent d5a297c commit 5ac17d3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 0 additions & 2 deletions ext/stream.class.js
Expand Up @@ -62,8 +62,6 @@ ChannelStream.prototype._read = function(size){

ChannelStream.prototype._write = function(data,enc,cbWrite)
{
if (!data)
return;
if(this._chan.state == 'gone') return cbWrite('closed');
// switch to our default encoding syntax
// dynamically detect object streams and change encoding
Expand Down
6 changes: 1 addition & 5 deletions ext/thtp.class.js
Expand Up @@ -71,11 +71,7 @@ function THTP_Response_fromHTTP(req, link, stream){
if (!head)
this.writeHead(200);

console.log()
if (data)
stream.end(data, enc, callback);
else
stream.end();
stream.end(data)
};


Expand Down
9 changes: 3 additions & 6 deletions test/ext/thtp.test.js
Expand Up @@ -85,8 +85,7 @@ describe('telehash/thtp', function(){
meshB.proxy(proxy);

// send request and gather response
linkAB.request('/test', function(err, res){
expect(err).to.not.exist;
linkAB.request('/test', function(res){
res.pipe(concat(function(body){
expect(body.toString()).to.be.equal('test');
done();
Expand Down Expand Up @@ -119,8 +118,7 @@ describe('telehash/thtp', function(){
meshB.proxy(proxy);

// send request and gather response
linkAB.request('/test', function(err, res){
expect(err).to.not.exist;
linkAB.request('/test', function(res){
res.pipe(concat(function(body){
fs
.createReadStream(__dirname + "/thtp.test.js")
Expand Down Expand Up @@ -153,8 +151,7 @@ describe('telehash/thtp', function(){
meshB.proxy("http://localhost:9876");
setTimeout(function(){

linkAB.request("http://localhost:9876/test", function(err, res){
expect(err).to.not.exist;
linkAB.request("http://localhost:9876/test", function( res){
res.pipe(concat(function(body){
expect(body.toString()).to.be.equal('test');
done();
Expand Down

0 comments on commit 5ac17d3

Please sign in to comment.