Skip to content

Commit

Permalink
fix: Ensure all tests run on Windows + Node 10 (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated authored Oct 31, 2021
1 parent b4d3f5a commit 857a564
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
12 changes: 0 additions & 12 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
11 changes: 8 additions & 3 deletions test/utils/create-symlinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 857a564

Please # to comment.