File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed
Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,9 @@ var Buffer = require('safe-buffer').Buffer
22var Client = require ( '../' )
33var common = require ( './common' )
44var test = require ( 'tape' )
5- var wrtc = require ( 'electron-webrtc' ) ( )
5+ var electronWebrtc = require ( 'electron-webrtc' )
66
7- var wrtcReady = false
8- wrtc . electronDaemon . once ( 'ready' , function ( ) {
9- wrtcReady = true
10- } )
7+ var wrtc
118
129var infoHash = '4cb67059ed6bd08362da625b3ae77f6f4a075705'
1310var peerId = Buffer . from ( '01234567890123456789' )
@@ -177,15 +174,11 @@ test('udp server', function (t) {
177174} )
178175
179176test ( 'ws server' , function ( t ) {
180- if ( wrtcReady ) {
181- runTest ( )
182- } else {
183- wrtc . electronDaemon . once ( 'ready' , runTest )
184- }
185- function runTest ( ) {
186- t . once ( 'end' , function ( ) {
187- wrtc . close ( )
188- } )
177+ wrtc = electronWebrtc ( )
178+ wrtc . electronDaemon . once ( 'ready' , function ( ) {
189179 serverTest ( t , 'ws' , 'inet' )
190- }
180+ } )
181+ t . once ( 'end' , function ( ) {
182+ wrtc . close ( )
183+ } )
191184} )
You can’t perform that action at this time.
0 commit comments