Skip to content

Commit

Permalink
chore(tests): update tests for status type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Jul 17, 2020
1 parent b89cd3c commit f143fe7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tap.test('API Problem', assert => {
Problem.DEFAULT_TYPE = DEFAULT_TYPE

assert.equal(new Problem(404, 'foo').title, 'foo', 'custom "title"')
assert.equal(new Problem(452, 'foo').status, '452', 'custom "status"')
assert.equal(new Problem(452, 'foo').status, 452, 'custom "status"')
assert.equal(new Problem(404, 'foo', 'foo://bar/').type, 'foo://bar/', 'custom "type" ')

assert.equal(new Problem(404, { foo: 'bar' }).foo, 'bar', 'members immediately after "status"')
Expand Down Expand Up @@ -70,7 +70,7 @@ tap.test('HTTP Response', assert => {

const response = {
writeHead: (status, headers) => {
assert.equal(status, '404', 'set correct status code')
assert.equal(status, 404, 'set correct status code')
assert.equal(headers['Content-Type'], CONTENT_TYPE, 'set correct Content-Type')
},

Expand Down
2 changes: 1 addition & 1 deletion test/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tap.test('Express Middleware', assert => {
const req = {}
let res = {
writeHead (status, headers) {
assert.equal(status, '404', 'set correct status code')
assert.equal(status, 404, 'set correct status code')
assert.same(headers, { 'Content-Type': CONTENT_TYPE }, 'set correct HTTP headers')
},

Expand Down

0 comments on commit f143fe7

Please sign in to comment.