Skip to content

Commit

Permalink
tests: separate res.send() chain test
Browse files Browse the repository at this point in the history
closes #3448
  • Loading branch information
chainhelen authored and dougwilson committed Jan 3, 2018
1 parent 53bee25 commit 950f442
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/res.send.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

var assert = require('assert')
var Buffer = require('safe-buffer').Buffer
var express = require('..');
var methods = require('methods');
Expand Down Expand Up @@ -54,7 +55,7 @@ describe('res', function(){
var app = express();

app.use(function(req, res){
res.send(201).should.equal(res);
res.send(201)
});

request(app)
Expand Down Expand Up @@ -354,6 +355,18 @@ describe('res', function(){
.expect('{"foo":"bar"}', done);
})

it('should be chainable', function (done) {
var app = express()

app.use(function (req, res) {
assert.equal(res.send('hey'), res)
})

request(app)
.get('/')
.expect(200, 'hey', done)
})

describe('"etag" setting', function () {
describe('when enabled', function () {
it('should send ETag', function (done) {
Expand Down

0 comments on commit 950f442

Please sign in to comment.