Skip to content
Myr

Added tests for enable/disable of settings

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

authored by Dav Glass · committed by Tj Holowaychuk · parent 268d19e · Browse files · 1 file+21 added−1 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+21 added−1 removed

  • tests:+21 added−1 removed

1 file+21 added−1 removed

modified:test/response.test.js+21 added-1 removed
17 unmodified lines
18 res.header('X-Foo', 'bar');19 res.send({ foo: 'bar' }, { 'X-Foo': 'baz' }, 201);20 });21 22 app.get('/jsonp', function(req, res){23 app.enable('jsonp callback');24 res.header('X-Foo', 'bar');25 res.send({ foo: 'bar' }, { 'X-Foo': 'baz' }, 201);26 app.disable('jsonp callback');27 });28 29 app.get('/text', function(req, res){30 res.header('X-Foo', 'bar');31 res.contentType('.txt');32 res.send('wahoo');
20 unmodified lines
53 { body: '<p>test</p>', headers: { 'Content-Language': 'en', 'Content-Type': 'text/html; charset=utf-8' }});54 assert.response(app,55 { url: '/json' },56 { body: '{"foo":"bar"}', status: 201, headers: { 'Content-Type': 'application/json', 'X-Foo': 'baz' }});5758 assert.response(app,59 { url: '/jsonp?callback=test' },60 { body: 'test({"foo":"bar"});', status: 201, headers: { 'Content-Type': 'application/json', 'X-Foo': 'baz' }});6162 assert.response(app,63 { url: '/jsonp?callback=baz' },64 { body: 'baz({"foo":"bar"});', status: 201, headers: { 'Content-Type': 'application/json', 'X-Foo': 'baz' }});6566 assert.response(app,67 { url: '/json?callback=test' },68 { body: '{"foo":"bar"}', status: 201, headers: { 'Content-Type': 'application/json', 'X-Foo': 'baz' }});6970 assert.response(app,71 { url: '/text' },72 { body: 'wahoo', headers: { 'Content-Type': 'text/plain; charset=utf-8', 'X-Foo': 'bar' }});73 assert.response(app,74 { url: '/status' },
321 unmodified lines
396 assert.response(app,397 { url: '/', method: 'HEAD' },398 { body: '', headers: { 'Content-Length': 11 }});399 }380};400};