Skip to content

Commit

Permalink
Add extra integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Oct 6, 2017
1 parent d4447dc commit 9c021e4
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions test/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,54 @@ describe('integrations', function() {
concat(assert),
], done);
});

it('(*nix) sources a symlink and copies it', function(done) {
if (isWindows) {
this.skip();
return;
}

fs.mkdirSync(base);
fs.mkdirSync(symlinkDirpath);
fs.symlinkSync(inputDirpath, outputSymlink);

function assert(files) {
var destResult = fs.readlinkSync(outputDirpathSymlink);

expect(destResult).toEqual(inputDirpath);
expect(files[0].symlink).toEqual(inputDirpath);
}

pipe([
vfs.src(outputSymlink, { resolveSymlinks: false }),
vfs.dest(outputDirpath),
concat(assert),
], done);
});

it('(windows) sources a junction and copies it', function(done) {
if (!isWindows) {
this.skip();
return;
}

fs.mkdirSync(base);
fs.mkdirSync(symlinkDirpath);
fs.symlinkSync(inputDirpath, outputSymlink, 'junction');

function assert(files) {
// Junctions add an ending separator
var expected = inputDirpath + path.sep;
var destResult = fs.readlinkSync(outputDirpathSymlink);

expect(destResult).toEqual(expected);
expect(files[0].symlink).toEqual(inputDirpath);
}

pipe([
vfs.src(outputSymlink, { resolveSymlinks: false }),
vfs.dest(outputDirpath),
concat(assert),
], done);
});
});

0 comments on commit 9c021e4

Please sign in to comment.