From 0305be95adad25b2f474c912c28b2e3d5daddd7b Mon Sep 17 00:00:00 2001 From: Karan Date: Fri, 28 Sep 2018 19:24:56 -0400 Subject: [PATCH] fix 473 --- tests/spec/fs.writeFile-readFile.spec.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/spec/fs.writeFile-readFile.spec.js b/tests/spec/fs.writeFile-readFile.spec.js index 589b273..56583d1 100644 --- a/tests/spec/fs.writeFile-readFile.spec.js +++ b/tests/spec/fs.writeFile-readFile.spec.js @@ -99,3 +99,25 @@ describe('fs.writeFile, fs.readFile', function() { }); }); }); + +describe('fsPromises.Write', function() { + it('should write, read a utf8 file without specifying utf8 in writeFile', function() { + //var fs = util.fs(); + //var contents = 'This is a file.'; + + var fsPromises = util.fs().promises; + + return fsPromises.writeFile('/myfile' , { encoding: 'utf8' }) + + .then(() => { + return fsPromises.readFile('/myfile', 'utf8') + + .catch((error) => { + + expect(error).not.to.exist; + //expect(data).to.equal(contents); + //done(); + }); + }); + }); +}); \ No newline at end of file