Skip to content
Myr

more tests

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 388ad90 · Browse files · 1 file+10 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+10 added−2 removed

  • tests:+10 added−2 removed

1 file+10 added−2 removed

modified:test/response.test.js+10 added-2 removed
13 unmodified lines
14 15 app.get('/html', function(req, res){16 res.send('<p>test</p>', { 'Content-Language': 'en' });17 });18 1819 app.get('/json', function(req, res){20 res.header('X-Foo', 'bar');21 res.send({ foo: 'bar' }, { 'X-Foo': 'baz' }, 201);22 });
14 unmodified lines
37 app.get('/status', function(req, res){38 res.send(404);39 });40 41 app.get('/status/text', function(req, res){42 res.send('Oh noes!', 404);43 });44 45 app.get('/error', function(req, res){46 res.send('Oh shit!', { 'Content-Type': 'text/plain' }, 500);47 });48
76 unmodified lines
125 , headers: {126 'Content-Type': 'text/plain'127 , 'X-Foo': 'bar'128 }});125 129130 assert.response(app,131 { url: '/status/text' },132 { body: 'Oh noes!', status: 404 });133134 assert.response(app,135 { url: '/status' },136 { body: 'Not Found'137 , status: 404138 , headers: { 'Content-Type': 'text/plain' }});
483 unmodified lines