@@ -36,7 +36,7 @@ describe('libbase64', () => {
36
36
} ) ;
37
37
38
38
it ( 'shoud encode Buffer to base64' , ( ) => {
39
- expect ( libbase64 . encode ( new Buffer ( [ 0x00 , 0x01 , 0x02 , 0x20 , 0x03 ] ) ) ) . to . equal ( 'AAECIAM=' ) ;
39
+ expect ( libbase64 . encode ( Buffer . from ( [ 0x00 , 0x01 , 0x02 , 0x20 , 0x03 ] ) ) ) . to . equal ( 'AAECIAM=' ) ;
40
40
} ) ;
41
41
} ) ;
42
42
@@ -62,7 +62,7 @@ describe('libbase64', () => {
62
62
lineLength : 9
63
63
} ) ;
64
64
65
- let bytes = new Buffer ( streamFixture [ 0 ] ) ,
65
+ let bytes = Buffer . from ( streamFixture [ 0 ] ) ,
66
66
i = 0 ,
67
67
buf = [ ] ,
68
68
buflen = 0 ;
@@ -89,7 +89,7 @@ describe('libbase64', () => {
89
89
}
90
90
91
91
let ord = bytes [ i ++ ] ;
92
- encoder . write ( new Buffer ( [ ord ] ) ) ;
92
+ encoder . write ( Buffer . from ( [ ord ] ) ) ;
93
93
setImmediate ( sendNextByte ) ;
94
94
} ;
95
95
@@ -99,7 +99,7 @@ describe('libbase64', () => {
99
99
it ( 'should transform incoming base64 to bytes' , done => {
100
100
let decoder = new libbase64 . Decoder ( ) ;
101
101
102
- let bytes = new Buffer ( streamFixture [ 1 ] ) ,
102
+ let bytes = Buffer . from ( streamFixture [ 1 ] ) ,
103
103
i = 0 ,
104
104
buf = [ ] ,
105
105
buflen = 0 ;
@@ -126,7 +126,7 @@ describe('libbase64', () => {
126
126
}
127
127
128
128
let ord = bytes [ i ++ ] ;
129
- decoder . write ( new Buffer ( [ ord ] ) ) ;
129
+ decoder . write ( Buffer . from ( [ ord ] ) ) ;
130
130
setImmediate ( sendNextByte ) ;
131
131
} ;
132
132
0 commit comments