Skip to content

Commit 950413f

Browse files
committed
add transform stream to regression
1 parent 81552cc commit 950413f

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ function globStream(globs, opt) {
289289
walker.walk(base);
290290
}
291291
} else {
292-
// If the strig is not a glob, we just check for the existence of it.
292+
// If the string is not a glob, we just check for the existence of it.
293293
walker.exists(glob);
294294
}
295295
});

test/index.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -889,19 +889,28 @@ function suite(moduleName) {
889889
});
890890

891891
it('does not end prematurely', function (done) {
892-
var gs = globStream(['./non-existent-file'], { cwd: dir, allowEmpty: true });
892+
var gs = globStream(['./fixtures/*.js'], { cwd: dir });
893893

894-
function setup() {
894+
function delayed() {
895895
stream.pipeline(
896896
[
897897
gs,
898+
new stream.Transform({
899+
objectMode: true,
900+
transform: function(data, enc, cb) {
901+
if (typeof enc === 'function') {
902+
cb = enc;
903+
}
904+
cb(null, data);
905+
}
906+
}),
898907
concat(),
899908
],
900909
done
901910
);
902911
}
903912

904-
setTimeout(setup, 10);
913+
setTimeout(delayed, 10);
905914
});
906915
});
907916

0 commit comments

Comments
 (0)