Permalink
Browse files

another test for script outer contents, passes

  • Loading branch information...
1 parent 2b91107 commit ffee9812fd191f691d96da561416e11ff4e392aa @substack committed Jul 10, 2013
Showing with 24 additions and 0 deletions.
  1. +24 −0 test/script_tr.js
View
24 test/script_tr.js
@@ -27,3 +27,27 @@ test('uppercase script contents', function (t) {
tr.write('</head></html>');
tr.end();
});
+
+test('uppercase script outer', function (t) {
+ t.plan(1);
+
+ var tr = trumpet();
+ var ts = tr.select('script').createStream({ outer: true });
+ ts.pipe(through(function (buf) {
+ this.queue(buf.toString().toUpperCase());
+ })).pipe(ts);
+
+ tr.pipe(concat(function (body) {
+ t.equal(
+ body.toString(),
+ '<html><head>'
+ + '<SCRIPT TYPE="ROBOTS">BEEPITY BOOP</SCRIPT>'
+ + '</head></html>'
+ );
+ }));
+
+ tr.write('<html><head>');
+ tr.write('<script type="robots">beepity boop</script>');
+ tr.write('</head></html>');
+ tr.end();
+});

0 comments on commit ffee981

Please sign in to comment.