File: header-test.js

package info (click to toggle)
node-http-server 14.1.1%2B~cs3.14.34-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,856 kB
  • sloc: javascript: 5,677; makefile: 8
file content (36 lines) | stat: -rw-r--r-- 1,168 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// var assert = require('assert'),
//     request = require('request'),
//     vows = require('vows'),
//     union = require('../');

// vows.describe('union/header').addBatch({
//   'When using `union`': {
//     'with a server that responds with a header': {
//       topic: function () {
//         var callback = this.callback;
//         var server = union.createServer({
//           before: [
//             function (req, res) {
//               res.on('header', function () {
//                 callback(null, res);
//               });
//               res.writeHead(200, { 'content-type': 'text' });
//               res.end();
//             }
//           ]
//         });
//         server.listen(9092, function () {
//           request('http://localhost:9092/');
//         });
//       },
//       'it should have proper `headerSent` set': function (err, res) {
//         assert.isNull(err);
//         assert.isTrue(res.headerSent);
//       },
//       'it should have proper `_emittedHeader` set': function (err, res) {
//         assert.isNull(err);
//         assert.isTrue(res._emittedHeader);
//       }
//     }
//   }
// }).export(module);