File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,7 @@ const assert = require('assert');
55const dgram = require ( 'dgram' ) ;
66const multicastAddress = '224.0.0.114' ;
77
8- const setup = ( ) => {
9- return dgram . createSocket ( { type : 'udp4' , reuseAddr : true } ) ;
10- } ;
8+ const setup = dgram . createSocket . bind ( dgram , { type : 'udp4' , reuseAddr : true } ) ;
119
1210// addMembership() on closed socket should throw
1311{
@@ -46,14 +44,16 @@ const setup = () => {
4644// addMembership() with invalid multicast address should throw
4745{
4846 const socket = setup ( ) ;
49- assert . throws ( ( ) => { socket . addMembership ( '256.256.256.256' ) ; } , / E I N V A L / ) ;
47+ assert . throws ( ( ) => { socket . addMembership ( '256.256.256.256' ) ; } ,
48+ / ^ E r r o r : a d d M e m b e r s h i p E I N V A L $ / ) ;
5049 socket . close ( ) ;
5150}
5251
5352// dropMembership() with invalid multicast address should throw
5453{
5554 const socket = setup ( ) ;
56- assert . throws ( ( ) => { socket . dropMembership ( '256.256.256.256' ) ; } , / E I N V A L / ) ;
55+ assert . throws ( ( ) => { socket . dropMembership ( '256.256.256.256' ) ; } ,
56+ / ^ E r r o r : d r o p M e m b e r s h i p E I N V A L $ / ) ;
5757 socket . close ( ) ;
5858}
5959
You can’t perform that action at this time.
0 commit comments