@@ -125,11 +125,7 @@ describe('high level API - with everything mixed all together!', function () {
125
125
126
126
it . skip ( 'add multiplex' , ( done ) => { } )
127
127
128
- it ( 'dial from tcp to tcp+ws' , ( done ) => {
129
- swarmB . handle ( '/anona/1.0.0' , ( conn ) => {
130
- conn . pipe ( conn )
131
- } )
132
-
128
+ it ( 'warm up from A to B on tcp to tcp+ws' , ( done ) => {
133
129
swarmB . once ( 'peer-mux-established' , ( peerInfo ) => {
134
130
expect ( peerInfo . id . toB58String ( ) ) . to . equal ( peerA . id . toB58String ( ) )
135
131
} )
@@ -138,6 +134,26 @@ describe('high level API - with everything mixed all together!', function () {
138
134
expect ( peerInfo . id . toB58String ( ) ) . to . equal ( peerB . id . toB58String ( ) )
139
135
} )
140
136
137
+ swarmA . dial ( peerB , ( err ) => {
138
+ expect ( err ) . to . not . exist
139
+ expect ( Object . keys ( swarmA . muxedConns ) . length ) . to . equal ( 1 )
140
+ done ( )
141
+ } )
142
+ } )
143
+
144
+ it ( 'warm up a warmed up, from B to A' , ( done ) => {
145
+ swarmB . dial ( peerA , ( err ) => {
146
+ expect ( err ) . to . not . exist
147
+ expect ( Object . keys ( swarmA . muxedConns ) . length ) . to . equal ( 1 )
148
+ done ( )
149
+ } )
150
+ } )
151
+
152
+ it ( 'dial from tcp to tcp+ws, on protocol' , ( done ) => {
153
+ swarmB . handle ( '/anona/1.0.0' , ( conn ) => {
154
+ conn . pipe ( conn )
155
+ } )
156
+
141
157
swarmA . dial ( peerB , '/anona/1.0.0' , ( err , conn ) => {
142
158
expect ( err ) . to . not . exist
143
159
expect ( Object . keys ( swarmA . muxedConns ) . length ) . to . equal ( 1 )
0 commit comments