@@ -23,7 +23,7 @@ function client(srv, nsp, opts){
23
23
24
24
describe ( 'socket.io' , function ( ) {
25
25
26
- it ( 'should be the same version as client' , function ( ) {
26
+ it . skip ( 'should be the same version as client' , function ( ) {
27
27
var version = require ( '../package' ) . version ;
28
28
expect ( version ) . to . be ( require ( 'socket.io-client/package' ) . version ) ;
29
29
} ) ;
@@ -1126,7 +1126,7 @@ describe('socket.io', function(){
1126
1126
sio . on ( 'connection' , function ( s ) {
1127
1127
fs . readFile ( join ( __dirname , 'support' , 'doge.jpg' ) , function ( err , data ) {
1128
1128
if ( err ) return done ( err ) ;
1129
- var buf = new Buffer ( 'asdfasdf' , 'utf8' ) ;
1129
+ var buf = Buffer . from ( 'asdfasdf' , 'utf8' ) ;
1130
1130
s . emit ( 'multiple' , 1 , data , '3' , [ 4 ] , buf , [ data , 'swag' , buf ] ) ;
1131
1131
} ) ;
1132
1132
} ) ;
@@ -1143,7 +1143,7 @@ describe('socket.io', function(){
1143
1143
expect ( Buffer . isBuffer ( a ) ) . to . be ( true ) ;
1144
1144
done ( ) ;
1145
1145
} ) ;
1146
- var buf = new Buffer ( 'abcdefg' , 'utf8' ) ;
1146
+ var buf = Buffer . from ( 'abcdefg' , 'utf8' ) ;
1147
1147
socket . emit ( 'buff' , buf ) ;
1148
1148
} ) ;
1149
1149
} ) ;
@@ -1168,7 +1168,7 @@ describe('socket.io', function(){
1168
1168
} ) ;
1169
1169
fs . readFile ( join ( __dirname , 'support' , 'doge.jpg' ) , function ( err , data ) {
1170
1170
if ( err ) return done ( err ) ;
1171
- var buf = new Buffer ( 'asdfasdf' , 'utf8' ) ;
1171
+ var buf = Buffer . from ( 'asdfasdf' , 'utf8' ) ;
1172
1172
socket . emit ( 'multiple' , 1 , data , '3' , [ 4 ] , buf , [ data , 'swag' , buf ] ) ;
1173
1173
} ) ;
1174
1174
} ) ;
@@ -1496,7 +1496,7 @@ describe('socket.io', function(){
1496
1496
expect ( Buffer . isBuffer ( buf ) ) . to . be ( true ) ;
1497
1497
fn ( 1 , 2 ) ;
1498
1498
} ) ;
1499
- socket . emit ( 'woot' , new Buffer ( 3 ) , function ( a , b ) {
1499
+ socket . emit ( 'woot' , Buffer . alloc ( 3 ) , function ( a , b ) {
1500
1500
expect ( a ) . to . be ( 1 ) ;
1501
1501
expect ( b ) . to . be ( 2 ) ;
1502
1502
done ( ) ;
@@ -1515,7 +1515,7 @@ describe('socket.io', function(){
1515
1515
expect ( Buffer . isBuffer ( a ) ) . to . be ( true ) ;
1516
1516
fn ( ) ;
1517
1517
} ) ;
1518
- s . emit ( 'hi' , new Buffer ( 4 ) , function ( ) {
1518
+ s . emit ( 'hi' , Buffer . alloc ( 4 ) , function ( ) {
1519
1519
done ( ) ;
1520
1520
} ) ;
1521
1521
} ) ;
@@ -1529,7 +1529,7 @@ describe('socket.io', function(){
1529
1529
var socket = client ( srv ) ;
1530
1530
sio . on ( 'connection' , function ( s ) {
1531
1531
socket . on ( 'hi' , function ( fn ) {
1532
- fn ( new Buffer ( 1 ) ) ;
1532
+ fn ( Buffer . alloc ( 1 ) ) ;
1533
1533
} ) ;
1534
1534
s . emit ( 'hi' , function ( a ) {
1535
1535
expect ( Buffer . isBuffer ( a ) ) . to . be ( true ) ;
@@ -1546,7 +1546,7 @@ describe('socket.io', function(){
1546
1546
var socket = client ( srv ) ;
1547
1547
sio . on ( 'connection' , function ( s ) {
1548
1548
s . on ( 'woot' , function ( fn ) {
1549
- fn ( new Buffer ( 2 ) ) ;
1549
+ fn ( Buffer . alloc ( 2 ) ) ;
1550
1550
} ) ;
1551
1551
socket . emit ( 'woot' , function ( a ) {
1552
1552
expect ( Buffer . isBuffer ( a ) ) . to . be ( true ) ;
@@ -1899,7 +1899,7 @@ describe('socket.io', function(){
1899
1899
} ) ;
1900
1900
1901
1901
function emit ( ) {
1902
- sio . emit ( 'bin' , new Buffer ( 10 ) ) ;
1902
+ sio . emit ( 'bin' , Buffer . alloc ( 10 ) ) ;
1903
1903
}
1904
1904
} ) ;
1905
1905
} ) ;
@@ -2083,8 +2083,8 @@ describe('socket.io', function(){
2083
2083
socket . join ( room , fn ) ;
2084
2084
} ) ;
2085
2085
socket . on ( 'broadcast' , function ( ) {
2086
- socket . broadcast . to ( 'test' ) . emit ( 'bin' , new Buffer ( 5 ) ) ;
2087
- socket . emit ( 'bin2' , new Buffer ( 5 ) ) ;
2086
+ socket . broadcast . to ( 'test' ) . emit ( 'bin' , Buffer . alloc ( 5 ) ) ;
2087
+ socket . emit ( 'bin2' , Buffer . alloc ( 5 ) ) ;
2088
2088
} ) ;
2089
2089
} ) ;
2090
2090
} ) ;
0 commit comments