res.sendStatus.js
This file
Path
test/res.sendStatus.js
32 lines · 679 bytes · JavaScript
Last changed by
Add res.sendStatusSeth Samuelbefore adoption12f92a5
History of this fileTake it
123456789101112131415161718192021222324252627282930313233
var assert = require('assert')var express = require('..')var request = require('supertest')
describe('res', function () { describe('.sendStatus(statusCode)', function () { it('should send the status code and message as body', function (done) { var app = express();
app.use(function(req, res){ res.sendStatus(201); });
request(app) .get('/') .expect(201, 'Created', done); })
it('should work with unknown code', function (done) { var app = express();
app.use(function(req, res){ res.sendStatus(599); });
request(app) .get('/') .expect(599, '599', done); }) })})