trumpet
Advanced tools
Comparing version 1.6.2 to 1.6.3
@@ -59,2 +59,11 @@ var through = require('through'); | ||
// End any read streams of unmatched selectors | ||
tr.on("end", function() { | ||
selectors.forEach(function(r) { | ||
r._readStreams.forEach(function(s) { | ||
if (s.readable) s.end(); | ||
}); | ||
}); | ||
}); | ||
return tr; | ||
@@ -61,0 +70,0 @@ |
{ | ||
"name" : "trumpet", | ||
"version" : "1.6.2", | ||
"version" : "1.6.3", | ||
"description" : "parse and transform streaming html using css selectors", | ||
@@ -5,0 +5,0 @@ "main" : "index.js", |
@@ -90,1 +90,10 @@ var trumpet = require('../'); | ||
}); | ||
test("end event when no match", function(t) { | ||
// Make sure an end event is emitted even with no "h1" element" | ||
var tr = trumpet(); | ||
tr.createReadStream("h1").on("end", function() { | ||
t.end(); | ||
}); | ||
fs.createReadStream(__dirname + '/read_stream.html').pipe(tr); | ||
}); |
76757
1502