From 389dedd3c0e85f6be3c547c9e492691502d0ad36 Mon Sep 17 00:00:00 2001 From: Julia McGeoghan Date: Tue, 9 Oct 2018 17:35:28 -0400 Subject: [PATCH] Fix #421 - Add test for fs.promises.link to ensure it returns a Promise (#462) * Add test * Move location of describe block * Remove comment * Have test check returnValue and not obj * Override package-lock.json with one from master branch * Improve naming of fsPromise variable to be more clear --- tests/spec/fs.link.spec.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/spec/fs.link.spec.js b/tests/spec/fs.link.spec.js index 0466ae4..ac74ee7 100644 --- a/tests/spec/fs.link.spec.js +++ b/tests/spec/fs.link.spec.js @@ -80,7 +80,6 @@ describe('fs.link', function() { fs.lstat('/myfileLink', function (error, result) { if (error) throw error; - var _linkstats = result; fs.lstat('/myotherfile', function (error, result) { expect(error).not.to.exist; @@ -110,4 +109,18 @@ describe('fs.link', function() { }); }); }); + +}); + +describe('fs.promises.link', function() { + + beforeEach(util.setup); + afterEach(util.cleanup); + + it('should return a promise', function() { + var fsPromise = util.fs().promises; + var returnValue = fsPromise.link('/myfile', '/myotherfile'); + expect(returnValue).to.be.a('promise'); + }); + });