Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

failing script tag transform test

  • Loading branch information...
commit 277c49665eb1bd7d88c08a3d77da91c7639a4159 1 parent a9a1bec
@substack authored
Showing with 29 additions and 0 deletions.
  1. +29 −0 test/script_tr.js
View
29 test/script_tr.js
@@ -0,0 +1,29 @@
+var trumpet = require('../');
+var fs = require('fs');
+var through = require('through');
+var test = require('tape');
+var concat = require('concat-stream');
+
+test('uppercase script contents', function (t) {
+ t.plan(1);
+
+ var tr = trumpet();
+ var ts = tr.select('script').createStream();
+ 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();
+});
Please sign in to comment.
Something went wrong with that request. Please try again.