File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,11 @@ describe("fs module", () => {
63
63
} ) ;
64
64
it ( "read file" , done => {
65
65
fs . mkdir ( "/readFile" , err => {
66
- fs . writeFile ( "/readFile/readFile-buffer .txt" , "HELLO" , err => {
66
+ fs . writeFile ( "/readFile/readFile-uint8 .txt" , "HELLO" , err => {
67
67
expect ( err ) . toBe ( null ) ;
68
- fs . readFile ( "/readFile/readFile-buffer .txt" , ( err , data ) => {
68
+ fs . readFile ( "/readFile/readFile-uint8 .txt" , ( err , data ) => {
69
69
expect ( err ) . toBe ( null ) ;
70
- expect ( data ) . toEqual ( Buffer . from ( HELLO ) ) ;
70
+ expect ( data ) . toEqual ( HELLO ) ;
71
71
done ( ) ;
72
72
} ) ;
73
73
} ) ;
Original file line number Diff line number Diff line change @@ -105,8 +105,6 @@ module.exports = class FS {
105
105
if ( data ) {
106
106
if ( encoding === "utf8" ) {
107
107
data = decode ( data ) ;
108
- } else {
109
- data = Buffer . from ( data ) ;
110
108
}
111
109
}
112
110
cb ( null , data ) ;
You can’t perform that action at this time.
0 commit comments