diff --git a/tests/spec/fs.write.spec.js b/tests/spec/fs.write.spec.js index ec5da7b..31f3025 100644 --- a/tests/spec/fs.write.spec.js +++ b/tests/spec/fs.write.spec.js @@ -1,24 +1,25 @@ -var util = require('../lib/test-utils.js'); -var expect = require('chai').expect; +'use strict'; +const util = require('../lib/test-utils.js'); +const expect = require('chai').expect; describe('fs.write', function() { beforeEach(util.setup); afterEach(util.cleanup); it('should be a function', function() { - var fs = util.fs(); + const fs = util.fs(); expect(fs.write).to.be.a('function'); }); it('should error if file path is undefined', function() { - var fs = util.fs(); - var fn = () => fs.writeFile(undefined, 'data'); + const fs = util.fs(); + const fn = () => fs.writeFile(undefined, 'data'); expect(fn).to.throw(); }); it('should write data to a file', function(done) { - var fs = util.fs(); - var buffer = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); + const fs = util.fs(); + const buffer = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); fs.open('/myfile', 'w', function(error, fd) { if(error) throw error; @@ -38,9 +39,9 @@ describe('fs.write', function() { }); it('should update the current file position', function(done) { - var fs = util.fs(); - var buffer = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - var _result = 0; + const fs = util.fs(); + const buffer = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); + let _result = 0; fs.open('/myfile', 'w', function(error, fd) { if(error) throw error;