Fix issue-447: Added test to append numbers in fs.appendFile function
This commit is contained in:
parent
1abcb0369b
commit
0395c4beae
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue