Test prefixes
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 6c3d3de · Browse files · 2 files·+11 added−11 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+11 added−11 removed
- tests:+11 added−11 removed
Provenance
- Commit
2ec4a8b- Tree
75cadb6- Author
Tj Holowaychuk <tj@vision-media.ca>- Committer
Tj Holowaychuk <tj@vision-media.ca>- Parent
6c3d3de
2 files changed+11 added−11 removed
modified:test/request.test.js+5 added-5 removed
9 unmodified lines1011121314141516171810 unmodified lines293031323333343536375 unmodified lines4344454647474849505132 unmodified lines8485868788888990919217 unmodified lines11011111211311411411511611711822 unmodified lines9 unmodified lines// Prevent reap timervar memoryStore = new MemoryStore({ reapInterval: -1 });
module.exports = { '#isXMLHttpRequest': function(assert){ 'test #isXMLHttpRequest': function(assert){ var app = express.createServer(); app.get('/isxhr', function(req, res, params){ assert.equal(req.xhr, req.isXMLHttpRequest);10 unmodified lines { url: '/isxhr', headers: { 'X-Requested-With': 'XMLHttpRequest' } }, { body: 'yeaaa boy' }); }, '#header()': function(assert){ 'test #header()': function(assert){ var app = express.createServer(); app.get('/', function(req, res){ assert.equal('foo.com', req.header('Host'));5 unmodified lines { url: '/', headers: { Host: 'foo.com' }}, { body: 'wahoo' }); }, '#accepts()': function(assert){ 'test #accepts()': function(assert){ var app = express.createServer(); app.get('/all', function(req, res){ assert.strictEqual(true, req.accepts('html'));32 unmodified lines { url: '/', headers: { Accept: 'text/html; application/json; text/*' }}, { body: 'ok' }); }, '#param()': function(assert){ 'test #param()': function(assert){ var app = express.createServer( connect.bodyDecoder() ); 17 unmodified lines { url: '/user', method: 'POST', data: 'id=1', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }}, { body: 'user 1' }); }, '#flash()': function(assert){ 'test #flash()': function(assert){ var app = express.createServer( connect.cookieDecoder(), connect.session({ store: memoryStore }) );22 unmodified linesmodified:test/response.test.js+6 added-6 removed
5 unmodified lines6 var express = require('express'),7 Buffer = require('buffer').Buffer;8 9 module.exports = {10- '#send()': function(assert){10+ 'test #send()': function(assert){11 var app = express.createServer();12 13 app.get('/html', function(req, res){14 res.send('<p>test</p>', { 'Content-Language': 'en' });41 unmodified lines56 { url: '/buffer' },57 { body: 'wahoo!', headers: { 'Content-Type': 'application/octet-stream' }});58 },59 60- '#contentType': function(assert){60+ 'test #contentType': function(assert){61 var app = express.createServer();62 63 app.get('/html', function(req, res){64 res.contentType('index.html');5 unmodified lines70 { url: '/html' },71 { body: '<p>yay</p>', headers: { 'Content-Type': 'text/html; charset=utf-8' }});72 },73 74- '#attachment': function(assert){74+ 'test #attachment': function(assert){75 var app = express.createServer();76 77 app.get('/style.css', function(req, res){78 res.attachment();12 unmodified lines91 { url: '/style.css' },92 { body: 'some stylezzz', headers: { 'Content-Disposition': 'attachment' }});93 },94 95- '#redirect()': function(assert){95+ 'test #redirect()': function(assert){96 var app = express.createServer(),97 app2 = express.createServer();98 99 app2.set('home', '/blog');70 unmodified lines170 { url: '/user/12' },171 { body: '', headers: { Location: '/user/12/blog' }});172 },173 174- '#sendfile()': function(assert){174+ 'test #sendfile()': function(assert){175 var app = express.createServer();176 177 app.get('/*', function(req, res, params){178 var file = params.splat[0];13 unmodified lines192 { url: '/partials' },193 { body: 'Internal Server Error', status: 500 });194 },195 196- '#download()': function(assert){196+ 'test #download()': function(assert){197 var app = express.createServer();198 199 app.get('/json', function(req, res, params, next){200 res.download(__dirname + '/fixtures/user.json', 'account.json');21 unmodified lines