Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

failing unwritable test for a no-longer writable stream

  • Loading branch information...
commit ec2ead33b587ae16ccce617f7da84a7bce245dce 1 parent d63ff14
@substack authored
View
6 example/https.js
@@ -6,7 +6,7 @@ var opts = {
var bouncy = require('bouncy');
bouncy(opts, function (req, bounce) {
- bounce(8000);
-}).listen(7000);
+ bounce(9000);
+}).listen(7005);
-console.log('https://localhost:7000');
+console.log('https://localhost:7005');
View
2  package.json
@@ -34,7 +34,7 @@
"morestreams" : "0.0.2"
},
"devDependencies" : {
- "tap" : "0.0.x",
+ "tap" : "~0.2.5",
"lazy" : "1.0.x",
"websocket-server" : "1.4.x",
"wsclient" : "0.2.x",
View
14 test/throw.js → test/unwritable.js
@@ -3,16 +3,17 @@ var bouncy = require('../');
var http = require('http');
var Stream = require('net').Stream;
-test('write() that throws', function (t) {
+test('write() on an unwritable stream', function (t) {
var port = Math.floor(Math.random() * (Math.pow(2,16) - 1e4) + 1e4);
- t.plan(4);
+ t.plan(1);
var s = bouncy(function (req, bounce) {
var stream = new Stream;
stream.writable = true;
stream.readable = true;
stream.write = function (buf) {
- throw new Error('!');
+ stream.writable = false;
+ t.ok(true);
};
stream.end = function () {};
@@ -37,6 +38,13 @@ test('write() that throws', function (t) {
};
var req = http.request(opts);
req.write('beep');
+ setTimeout(function () {
+ req.write('boop');
+ }, 100);
req.end();
});
+
+ t.on('end', function () {
+ s.close();
+ });
});
Please sign in to comment.
Something went wrong with that request. Please try again.