Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLi119 committed Jan 31, 2019
1 parent 36d23ff commit 8aa5cbb
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tests/spec/fs.appendFile.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('fs.appendFile', function() {

beforeEach(function(done) {
util.setup(function() {
let fs = util.fs();
const fs = util.fs();
fs.writeFile('/myfile', contents, function(error) {
if(error) throw error;
done();
Expand All @@ -18,12 +18,12 @@ describe('fs.appendFile', function() {
afterEach(util.cleanup);

it('should be a function', function() {
let fs = util.fs();
const fs = util.fs();
expect(fs.appendFile).to.be.a('function');
});

it('should append a utf8 file without specifying utf8 in appendFile', function(done) {
let fs = util.fs();
const fs = util.fs();
const more = ' Appended.';

fs.appendFile('/myfile', more, function(error) {
Expand All @@ -38,7 +38,7 @@ describe('fs.appendFile', function() {
});

it('should append a utf8 file with "utf8" option to appendFile', function(done) {
let fs = util.fs();
const fs = util.fs();
const more = ' Appended.';

fs.appendFile('/myfile', more, 'utf8', function(error) {
Expand All @@ -53,7 +53,7 @@ describe('fs.appendFile', function() {
});

it('should append a utf8 file with {encoding: "utf8"} option to appendFile', function(done) {
let fs = util.fs();
const fs = util.fs();
const more = ' Appended.';

fs.appendFile('/myfile', more, { encoding: 'utf8' }, function(error) {
Expand All @@ -68,7 +68,7 @@ describe('fs.appendFile', function() {
});

it('should append a binary file', function(done) {
let fs = util.fs();
const fs = util.fs();

// String and utf8 binary encoded versions of the same thing: 'This is a file.'
const binary = Buffer.from([84, 104, 105, 115, 32, 105, 115, 32, 97, 32, 102, 105, 108, 101, 46]);
Expand All @@ -92,7 +92,7 @@ describe('fs.appendFile', function() {
});

it('should follow symbolic links', function(done) {
let fs = util.fs();
const fs = util.fs();
const contents = 'This is a file.';
const more = ' Appended.';

Expand All @@ -112,7 +112,7 @@ describe('fs.appendFile', function() {
});

it('should work when file does not exist, and create the file', function(done) {
let fs = util.fs();
const fs = util.fs();

fs.appendFile('/newfile', contents, { encoding: 'utf8' }, function(error) {
expect(error).not.to.exist;
Expand All @@ -126,7 +126,7 @@ describe('fs.appendFile', function() {
});

it('should accept numbers and append them to the file', function(done) {
let fs = util.fs();
const fs = util.fs();
const more = 10000;

fs.appendFile('/myfile', more, 'utf8', function(error) {
Expand All @@ -144,7 +144,7 @@ describe('fs.appendFile', function() {
describe('fs.promises.appendFile', function() {
beforeEach(function(done) {
util.setup(function() {
let fs = util.fs();
const fs = util.fs();
return fs.promises.writeFile('/myfile', 'This is a file.', { encoding: 'utf8' })
.then(done)
.catch(done);
Expand All @@ -153,12 +153,12 @@ describe('fs.promises.appendFile', function() {
afterEach(util.cleanup);

it('should be a function', function() {
let fs = util.fs();
const fs = util.fs();
expect(fs.promises.appendFile).to.be.a('function');
});

it('should append a utf8 file without specifying utf8 in appendFile', function() {
let fs = util.fs();
const fs = util.fs();
const contents = 'This is a file.';
const more = ' Appended.';

Expand All @@ -168,7 +168,7 @@ describe('fs.promises.appendFile', function() {
});

it('should append a utf8 file with "utf8" option to appendFile', function() {
let fs = util.fs();
const fs = util.fs();
const contents = 'This is a file.';
const more = ' Appended.';

Expand All @@ -178,7 +178,7 @@ describe('fs.promises.appendFile', function() {
});

it('should append a utf8 file with {encoding: "utf8"} option to appendFile', function() {
let fs = util.fs();
const fs = util.fs();
const contents = 'This is a file.';
const more = ' Appended.';

Expand All @@ -188,7 +188,7 @@ describe('fs.promises.appendFile', function() {
});

it('should append a binary file', function() {
let fs = util.fs();
const fs = util.fs();

// String and utf8 binary encoded versions of the same thing: 'This is a file.'
const binary = new Buffer([84, 104, 105, 115, 32, 105, 115, 32, 97, 32, 102, 105, 108, 101, 46]);
Expand All @@ -203,7 +203,7 @@ describe('fs.promises.appendFile', function() {
});

it('should follow symbolic links', function() {
let fs = util.fs();
const fs = util.fs();
const contents = 'This is a file.';
const more = ' Appended.';

Expand All @@ -214,7 +214,7 @@ describe('fs.promises.appendFile', function() {
});

it('should work when file does not exist, and create the file', function() {
let fs = util.fs();
const fs = util.fs();
const contents = 'This is a file.';

return fs.promises.appendFile('/newfile', contents, { encoding: 'utf8' })
Expand Down

0 comments on commit 8aa5cbb

Please sign in to comment.