From 5568c27becc7f23bfe3f914a2bf6fe8ac9985c17 Mon Sep 17 00:00:00 2001 From: Deepanjali Gerangal <35698703+deepanjali19@users.noreply.github.com> Date: Sat, 20 Oct 2018 16:57:45 -0400 Subject: [PATCH] fix for #542 for fsPromises.symlink(target, path[, type]) (#543) * updating fs.symlink for promises * updated the requested changes * fix#542 added a newline at end --- tests/spec/fs.symlink.spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/spec/fs.symlink.spec.js b/tests/spec/fs.symlink.spec.js index 1e4e9b1..7b14129 100644 --- a/tests/spec/fs.symlink.spec.js +++ b/tests/spec/fs.symlink.spec.js @@ -44,3 +44,20 @@ describe('fs.symlink', function() { }); }); }); + + +describe('fsPromises.symlink', function () { + beforeEach(util.setup); + afterEach(util.cleanup); + + + it('should return an error if part of the parent destination path does not exist', () => { + var fsPromises = util.fs().promises; + + return fsPromises.symlink('/', '/tmp/mydir') + .catch(error => { + expect(error).to.exist; + expect(error.code).to.equal('ENOENT'); + }); + }); +});