Skip to content

Commit

Permalink
Merge pull request #46 from sindresorhus/stevemao-patch-1
Browse files Browse the repository at this point in the history
Fix docs, tests and bump `streamfilter`
  • Loading branch information
sindresorhus committed Aug 21, 2015
2 parents 909937f + 93d4c4b commit 83b219b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dependencies": {
"gulp-util": "^3.0.6",
"multimatch": "^2.0.0",
"streamfilter": "^1.0.1"
"streamfilter": "^1.0.5"
},
"devDependencies": {
"mocha": "*"
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ gulp.task('default', function () {

### filter(pattern, [options])

Returns a [transform stream](http://nodejs.org/api/stream.html#stream_class_stream_transform) with a [.restore()](#streamrestore) method.
Returns a [transform stream](http://nodejs.org/api/stream.html#stream_class_stream_transform) with a [.restore](#optionsrestore) object.

#### pattern

Expand Down
12 changes: 6 additions & 6 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ describe('filter.restore', function () {
});

it('should work when using multiple filters', function (cb) {
var streamFilter1 = filter(['*.json', '*.js'], {restore: true});
var streamFilter1 = filter(['*.js'], {restore: true});
var streamFilter2 = filter(['*.json'], {restore: true});
var buffer = [];

Expand Down Expand Up @@ -251,10 +251,10 @@ describe('filter.restore', function () {
buffer.push(file);

if (buffer.length === 4) {
assert.equal(buffer[0].path, 'app.js');
assert.equal(buffer[1].path, 'app2.js');
assert.equal(buffer[2].path, 'package.json');
assert.equal(buffer[3].path, 'package2.json');
assert.equal(buffer[0].path, 'package.json');
assert.equal(buffer[1].path, 'app.js');
assert.equal(buffer[2].path, 'package2.json');
assert.equal(buffer[3].path, 'app2.js');
cb();
}
});
Expand All @@ -263,11 +263,11 @@ describe('filter.restore', function () {
done(new Error('Not expected to end!'));
});

stream.pipe(restoreStream);
stream.write(new gutil.File({path: 'package.json'}));
stream.write(new gutil.File({path: 'app.js'}));
stream.write(new gutil.File({path: 'package2.json'}));
stream.write(new gutil.File({path: 'app2.js'}));
stream.pipe(restoreStream);
});

it('should work when restore stream is not used', function (cb) {
Expand Down

0 comments on commit 83b219b

Please sign in to comment.