Skip to content

Commit

Permalink
Add unit tests for emitting symbolic vinyls
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Sep 29, 2017
1 parent 6dae1c6 commit 9bd02c5
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/dest-symlinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,28 @@ describe('.dest() with symlinks', function() {
], done);
});

it('emits Vinyl files that are symbolic', function(done) {
var file = new File({
base: inputBase,
path: inputPath,
contents: null,
});

// `src()` adds this side-effect with `resolveSymlinks` option set to false
file.symlink = inputPath;

function assert(files) {
expect(files.length).toEqual(1);
expect(files[0].isSymbolic()).toEqual(true);
}

pipe([
from.obj([file]),
vfs.dest(outputBase),
concat(assert),
], done);
});

it('can create relative links', function(done) {
var file = new File({
base: inputBase,
Expand Down
19 changes: 19 additions & 0 deletions test/symlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,25 @@ describe('symlink stream', function() {
], done);
});

it('emits Vinyl objects that are symbolic', function(done) {
var file = new File({
base: inputBase,
path: inputPath,
contents: null,
});

function assert(files) {
expect(files.length).toEqual(1);
expect(files[0].isSymbolic()).toEqual(true);
}

pipe([
from.obj([file]),
vfs.symlink(outputBase),
concat(assert),
], done);
});

it('(*nix) creates a link for a directory', function(done) {
if (isWindows) {
this.skip();
Expand Down

0 comments on commit 9bd02c5

Please sign in to comment.