From ba188169d663c44694e9304b2e1835d78c10825e Mon Sep 17 00:00:00 2001 From: David Humphrey Date: Mon, 17 Dec 2018 16:06:24 -0500 Subject: [PATCH] Review fixes, skip copyFile test for now --- tests/spec/fs.copyFile.spec.js | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/tests/spec/fs.copyFile.spec.js b/tests/spec/fs.copyFile.spec.js index a1fe4c7..940f2fb 100644 --- a/tests/spec/fs.copyFile.spec.js +++ b/tests/spec/fs.copyFile.spec.js @@ -1,17 +1,17 @@ var util = require('../lib/test-utils.js'); var expect = require('chai').expect; -describe('fs.copyFile', function(){ +// Waiting on implementation to land https://github.com/filerjs/filer/issues/436 +describe.skip('fs.copyFile', function() { + const file = { + path: '/srcfile', + contents: 'This is a src file.' + }; + beforeEach(function(done){ util.setup(function() { var fs = util.fs(); - fs.writeFile('/srcfile', 'This is a src file.', function(error){ - if(error) throw error; - fs.writeFile('/destfile', 'This is a dest file.', function(error){ - if(error) throw error; - done(); - }); - }); + fs.writeFile(file.path, file.contents, done); }); }); afterEach(util.cleanup); @@ -23,30 +23,26 @@ describe('fs.copyFile', function(){ it('should return an error if the src path does not exist', function(done){ var fs = util.fs(); - var src = null; - var dest = 'dest.txt'; - fs.copyFile(src, dest, function(error){ + fs.copyFile(null, '/dest.txt', function(error) { expect(error).to.exist; expect(error.code).to.equal('ENOENT'); done(); }); - }); it('should copy file successfully', function(done) { var fs = util.fs(); - var src = 'This is a src file.'; + const destPath = '/destfile'; - fs.copyFile('/srcfile', '/destfile', function(error) { + fs.copyFile(file.path, destPath, function(error) { if(error) throw error; - fs.readFile('/destfile', function(error, data){ + fs.readFile(destPath, function(error, data) { expect(error).not.to.exist; - expect(data).to.equal(src); + expect(data).to.equal(file.contents); done(); }); }); }); - -}); \ No newline at end of file +});