Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

modify a header in the test

  • Loading branch information...
commit eee53d32e1afc7b8285056cd8f54c2b96e1918e7 1 parent e73bbc6
James Halliday authored

Showing 2 changed files with 13 additions and 1 deletion. Show diff stats Hide diff stats

  1. +1 0  package.json
  2. +12 1 test/filed.js
1  package.json
@@ -9,6 +9,7 @@
9 9 },
10 10 "devDependencies" : {
11 11 "tap" : "~0.3.0",
  12 + "event-stream" : "~3.0.2",
12 13 "filed" : "git://github.com/substack/filed.git#return_dest"
13 14 },
14 15 "scripts" : {
13 test/filed.js
@@ -9,7 +9,7 @@ var fs = require('fs');
9 9 var fileContents = fs.readFileSync(__dirname + '/data.txt');
10 10
11 11 test('filed response', function (t) {
12   - t.plan(2);
  12 + t.plan(3);
13 13
14 14 var port = Math.floor(Math.random() * 5e4 + 1e4);
15 15 var server = http.createServer(function (req, res) {
@@ -35,6 +35,10 @@ test('filed response', function (t) {
35 35 Number(res.headers['content-length']),
36 36 fileContents.length
37 37 );
  38 + t.equal(
  39 + res.headers['content-type'],
  40 + 'TEXT/PLAIN'
  41 + );
38 42 });
39 43 });
40 44 });
@@ -47,6 +51,13 @@ test('filed response', function (t) {
47 51 var s = responseStream(es.mapSync(function (s) {
48 52 return String(s).toUpperCase()
49 53 }));
  54 +
  55 + s.on('setHeader', function (args, pass) {
  56 + if (args[0] === 'content-type') {
  57 + args[1] = String(args[1]).toUpperCase();
  58 + }
  59 + });
  60 +
50 61 return s;
51 62 }
52 63 });

0 comments on commit eee53d3

Please sign in to comment.
Something went wrong with that request. Please try again.