File tree 1 file changed +10
-2
lines changed 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,16 @@ var Client = require(__dirname + '/../lib/client');
2
2
var buffers = require ( __dirname + '/../test/test-buffers' ) ;
3
3
require ( __dirname + '/../test/unit/test-helper' ) ;
4
4
5
- var stream = new MemoryStream ( ) ;
5
+ var stream = new require ( 'stream' ) . PassThrough ( ) ;
6
6
stream . readyState = 'open' ;
7
+ stream . write = function ( ) {
8
+ //the stream used in the connection is
9
+ //already considered a duplex stream
10
+ //and its write method is used for writing
11
+ //out to postgres so for the benchmark
12
+ //ignore all writing so outgoing buffers
13
+ //do not get sent to the reader
14
+ } ;
7
15
var client = new Client ( {
8
16
stream : stream
9
17
} ) ;
@@ -52,7 +60,7 @@ client.connect(assert.calls(function() {
52
60
assert . equal ( res . rows . length , 9 ) ;
53
61
done ( ) ;
54
62
} ) ;
55
- buffers . forEach ( stream . emit . bind ( stream , 'data' ) ) ;
63
+ buffers . forEach ( stream . push . bind ( stream ) ) ;
56
64
} ;
57
65
} ;
58
66
} ) ) ;
You can’t perform that action at this time.
0 commit comments