From 857a56482c39413bb7891355f039659aeb86c46b Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Sun, 31 Oct 2021 15:49:00 -0400 Subject: [PATCH] fix: Ensure all tests run on Windows + Node 10 (#14) --- test/index.js | 12 ------------ test/utils/create-symlinks.js | 11 ++++++++--- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/test/index.js b/test/index.js index 37c1258..428e205 100644 --- a/test/index.js +++ b/test/index.js @@ -1613,12 +1613,6 @@ describe('Symbolic links', function () { }); it('returns symlink path when found link points to a directory', function (done) { - // Fail on Windows and Node v10,v11, because of: - // https://github.com/nodejs/node/pull/23724 - if (isWindows && ['v10', 'v11'].includes(process.version.split('.')[0])) { - this.skip(); - } - var pathObj = { path: '.', name: symlinkedFiles[4].name, @@ -1720,12 +1714,6 @@ describe('Symbolic links', function () { }); it('returns symlink path during findUp when symlink points to a directory', function (done) { - // Fail on Windows and Node v10,v11, because of: - // https://github.com/nodejs/node/pull/23724 - if (isWindows && ['v10', 'v11'].includes(process.version.split('.')[0])) { - this.skip(); - } - var pathObj = { path: path.basename(symlinkedFiles[4].dir), name: symlinkedFiles[4].name, diff --git a/test/utils/create-symlinks.js b/test/utils/create-symlinks.js index d153497..a62a5ce 100644 --- a/test/utils/create-symlinks.js +++ b/test/utils/create-symlinks.js @@ -16,10 +16,15 @@ if (fs.existsSync(symlinkedFiles[0])) { } } -var linkedFiles = ['package.json', 'xxxx', 'test/']; +var linkedFiles = [ + { path: 'package.json', type: 'file' }, + { path: 'xxxx', type: 'file' }, + { path: 'test/', type: 'dir' } +]; for (var i = 0, n = linkedFiles.length; i < n; i++) { - fs.symlinkSync(path.resolve(basedir, linkedFiles[i]), symlinkedFiles[i * 2]); - fs.symlinkSync(symlinkedFiles[i * 2], symlinkedFiles[i * 2 + 1]); + var file = linkedFiles[i]; + fs.symlinkSync(path.resolve(basedir, file.path), symlinkedFiles[i * 2], file.type); + fs.symlinkSync(symlinkedFiles[i * 2], symlinkedFiles[i * 2 + 1], file.type); } module.exports = symlinkedFiles.map(function (pth) {