File tree 2 files changed +40
-1
lines changed
2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ function ForwardStream(options) {
24
24
var self = this ;
25
25
26
26
self . options = options ;
27
- self . res = res ;
27
+ // To uncomment the line below, please see
28
+ // https://github.com/yawnt/caronte/commit/9ab8749a9bec33b49c495975e8364336ad7be1a3#commitcomment-3947117
29
+ //self.res = res;
28
30
29
31
Writable . call ( this ) ;
30
32
Original file line number Diff line number Diff line change
1
+ var ForwardStream = require ( '../lib/caronte/streams/forward' ) ,
2
+ expect = require ( 'expect.js' ) ,
3
+ Writable = require ( 'stream' ) . Writable ,
4
+ http = require ( 'http' ) ;
5
+
6
+
7
+ describe ( 'lib/caronte/passes/web.js' , function ( ) {
8
+ describe ( 'forward stream constructor' , function ( ) {
9
+ it ( 'should be an instance of Writable stream and get the correct options and methods' , function ( ) {
10
+ var stubOptions = {
11
+ key : 'value'
12
+ } ;
13
+ var forwardProxy = new ForwardStream ( stubOptions ) ;
14
+
15
+ expect ( forwardProxy ) . to . be . a ( Writable ) ;
16
+ expect ( forwardProxy . options ) . to . eql ( { key : 'value' } ) ;
17
+ expect ( forwardProxy . onPipe ) . to . be . a ( 'function' ) ;
18
+ expect ( forwardProxy . onFinish ) . to . be . a ( 'function' ) ;
19
+ expect ( forwardProxy . _events ) . to . have . property ( 'pipe' ) ;
20
+ expect ( forwardProxy . _events ) . to . have . property ( 'finish' ) ;
21
+ } ) ;
22
+ } ) ;
23
+
24
+ describe ( 'should pipe the request and finish it' , function ( ) {
25
+ it ( 'should make the request on pipe and finish it' ) ;
26
+ var stubOptions = {
27
+ target : {
28
+ hostname : 'www.google.com' ,
29
+ port : '80' ,
30
+ path : '/'
31
+ }
32
+ } ;
33
+
34
+ var forwardProxy = new ForwardStream ( { } ) ;
35
+
36
+ } ) ;
37
+ } ) ;
You can’t perform that action at this time.
0 commit comments