Skip to content

Commit

Permalink
fixup! add test describe block for valid range
Browse files Browse the repository at this point in the history
  • Loading branch information
jonchurch committed May 4, 2024
1 parent 63192c4 commit f7b7e35
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion test/res.status.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,39 @@ describe('res', function () {

request(app)
.get('/')
.expect(501, done)
.expect(700, done)
})
})

describe('when "code" is 800', function () {
it('should set the response status code to 501', function (done) {
var app = express()

app.use(function (req, res) {
res.status(800).end()
})

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

describe('when "code" is 900', function () {
it('should set the response status code to 501', function (done) {
var app = express()

app.use(function (req, res) {
res.status(800).end()
})

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

describe('invalid status codes', function () {
it('should raise error for status code below 100', function (done) {
var app = express();
Expand Down

0 comments on commit f7b7e35

Please sign in to comment.