From 0395c4beae59f4f93acf896343f912c0f24b0c7a Mon Sep 17 00:00:00 2001 From: PopeSpaceous Date: Sat, 22 Sep 2018 16:38:14 -0400 Subject: [PATCH] Fix issue-447: Added test to append numbers in fs.appendFile function --- tests/spec/fs.appendFile.spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/spec/fs.appendFile.spec.js b/tests/spec/fs.appendFile.spec.js index 8b41880..21bf27c 100644 --- a/tests/spec/fs.appendFile.spec.js +++ b/tests/spec/fs.appendFile.spec.js @@ -124,6 +124,22 @@ describe('fs.appendFile', function() { }); }); }); + + it('should accept numbers and appends them to the file', function(done) { + var fs = util.fs(); + var contents = 'This is a file.'; + var more = 10000; + + fs.appendFile('/myfile', more, 'utf8', function(error) { + if(error) throw error; + + fs.readFile('/myfile', 'utf8', function(error, data) { + expect(error).not.to.exist; + expect(data).to.equal(contents + more); + done(); + }); + }); + }); }); describe('fs.promises.appendFile', function() {