filer
filer copied to clipboard
Add testing for promises to all test cases in fs.writeFile-readFile.spec.js file
Currently the fs.writeFile-readFile.spec.js file in the tests/spec folder tests the following cases for the fs.readFile() and fs.writeFile() methods:
✔ should be a function
✔ should error when path is wrong to readFile
✔ should write, read a utf8 file without specifying utf8 in writeFile
✔ should write, read a utf8 file with "utf8" option to writeFile
✔ should write, read a utf8 file with {encoding: "utf8"} option to writeFile
✔ should write, read a binary file
✔ should follow symbolic links
I will be performing the same tests with fs.promises.readFile() and fs.promises.writeFile() to ensure that the integration of promises in filer works as expected with readFile and writeFile methods.
In addition, I will also check that fs.promises.readFile() and fs.promises.writeFile() methods return a promise as expected (specified in node.js docs).