@@ -7,7 +7,7 @@ test('connection can take existing stream', function () {
7
7
assert . equal ( con . stream , stream )
8
8
} )
9
9
10
- // test('using any stream', function () {
10
+ test ( 'using any stream' , function ( ) {
11
11
// var makeStream = function () {
12
12
// var stream = new MemoryStream()
13
13
@@ -20,10 +20,10 @@ test('connection can take existing stream', function () {
20
20
// }
21
21
22
22
// var stream = makeStream()
23
-
24
- // var con = new Connection({ stream: stream })
25
- // con = new Client({connection: con})
26
- // con.connect()
23
+ var stream = new MemoryStream ( )
24
+ var con = new Connection ( { stream : stream } )
25
+ con = new Client ( { connection : con } )
26
+ con . connect ( )
27
27
// con.websocket.close()
28
28
// con.end()
29
29
// test('makes stream connect', function () {
@@ -38,16 +38,16 @@ test('connection can take existing stream', function () {
38
38
// assert.equal(stream.host, 'bang')
39
39
// })
40
40
41
- // test('after stream connects client emits connected event', function () {
42
- // var hit = false
41
+ test ( 'after stream connects client emits connected event' , function ( ) {
42
+ var hit = false
43
43
44
- // con.once('connect', function () {
45
- // hit = true
46
- // })
44
+ con . once ( 'connect' , function ( ) {
45
+ hit = true
46
+ } )
47
47
48
- // assert.ok(stream .emit('connect'))
49
- // assert.ok(hit)
50
- // })
48
+ assert . ok ( con . emit ( 'connect' ) )
49
+ assert . ok ( hit )
50
+ } )
51
51
52
52
// TCP-keepalive not relevant for websockets
53
53
@@ -67,4 +67,4 @@ test('connection can take existing stream', function () {
67
67
// assert.equal(res, true)
68
68
// })
69
69
// })
70
- // })
70
+ } )
0 commit comments