res.type.js
This file
Path
test/res.type.js
22 lines · 521 bytes · JavaScript
Last changed by
Not known.
History of this fileTake it
1234567891011121314151617181920212223
var express = require('../') , request = require('./support/http');
describe('res', function(){ describe('.type(str)', function(){ it('should set the Content-Type based on a filename', function(done){ var app = express();
app.use(function(req, res){ res.type('foo.js').end('var name = "tj";'); });
request(app) .get('/') .end(function(res){ res.headers.should.have.property('content-type', 'application/javascript'); done(); }) }) })})