3 var assert
= require('assert')
4 var express
= require('../');
5 var request
= require('supertest');
7 describe('exports', function(){
8 it('should expose Router', function(){
9 assert
.strictEqual(typeof express
.Router
, 'function')
12 it('should expose json middleware', function () {
13 assert
.equal(typeof express
.json
, 'function')
14 assert
.equal(express
.json
.length
, 1)
17 it('should expose raw middleware', function () {
18 assert
.equal(typeof express
.raw
, 'function')
19 assert
.equal(express
.raw
.length
, 1)
22 it('should expose static middleware', function () {
23 assert
.equal(typeof express
.static, 'function')
24 assert
.equal(express
.static.length
, 2)
27 it('should expose text middleware', function () {
28 assert
.equal(typeof express
.text
, 'function')
29 assert
.equal(express
.text
.length
, 1)
32 it('should expose urlencoded middleware', function () {
33 assert
.equal(typeof express
.urlencoded
, 'function')
34 assert
.equal(express
.urlencoded
.length
, 1)
37 it('should expose the application prototype', function(){
38 assert
.strictEqual(typeof express
.application
, 'object')
39 assert
.strictEqual(typeof express
.application
.set, 'function')
42 it('should expose the request prototype', function(){
43 assert
.strictEqual(typeof express
.request
, 'object')
44 assert
.strictEqual(typeof express
.request
.accepts
, 'function')
47 it('should expose the response prototype', function(){
48 assert
.strictEqual(typeof express
.response
, 'object')
49 assert
.strictEqual(typeof express
.response
.send
, 'function')
52 it('should permit modifying the .application prototype', function(){
53 express
.application
.foo = function(){ return 'bar'; };
54 assert
.strictEqual(express().foo(), 'bar')
57 it('should permit modifying the .request prototype', function(done
){
58 express
.request
.foo = function(){ return 'bar'; };
61 app
.use(function(req
, res
, next
){
70 it('should permit modifying the .response prototype', function(done
){
71 express
.response
.foo = function(){ this.send('bar'); };
74 app
.use(function(req
, res
, next
){