Skip to content

Commit

Permalink
add new glob tests, empty string is a failing glob now. google/materi…
Browse files Browse the repository at this point in the history
  • Loading branch information
yocontra authored and phated committed Nov 28, 2017
1 parent c2f034a commit 326521b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/dest.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('dest stream', function() {
beforeEach(wipeOut);
afterEach(wipeOut);

it('should explode on invalid folder', function(done) {
it('should explode on invalid folder (empty)', function(done) {
var stream;
try {
stream = gulp.dest();
Expand All @@ -48,6 +48,17 @@ describe('dest stream', function() {
}
});

it('should explode on invalid folder (empty string)', function(done) {
var stream;
try {
stream = gulp.dest('');
} catch (err) {
should.exist(err);
should.not.exist(stream);
done();
}
});

it('should pass through writes with cwd', function(done) {
var inputPath = path.join(__dirname, './fixtures/test.coffee');

Expand Down
22 changes: 22 additions & 0 deletions test/src.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ describe('source stream', function() {
}
});

it('should explode on invalid glob (empty string)', function(done) {
var stream;
try {
stream = vfs.src('');
} catch (err) {
should.exist(err);
should.not.exist(stream);
done();
}
});

it('should explode on invalid glob (number)', function(done) {
var stream;
try {
Expand All @@ -53,6 +64,17 @@ describe('source stream', function() {
}
});

it('should explode on invalid glob (empty string in array)', function(done) {
var stream;
try {
stream = vfs.src(['']);
} catch (err) {
should.exist(err);
should.not.exist(stream);
done();
}
});

it('should not explode on invalid glob (empty array)', function(done) {
var stream = vfs.src([]);
stream.once('data', done);
Expand Down

0 comments on commit 326521b

Please sign in to comment.