Skip to content
Myr

Merge tag '3.8.0'

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

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parents e7e2592, f6bbeaf · Browse files · 19 files+612 added−157 removed
This commit

State

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

Diff stats

19 files+612 added−157 removed

  • tests:+545 added−153 removed
  • other:+67 added−4 removed

19 files+612 added−157 removed

modified:lib/response.js+16 added-1 removed
7 unmodified lines
8var escapeHtml = require('escape-html');9var sign = require('cookie-signature').sign;10var normalizeType = require('./utils').normalizeType;11var normalizeTypes = require('./utils').normalizeTypes;12var setCharset = require('./utils').setCharset;13var contentDisposition = require('./utils').contentDisposition;14var deprecate = require('./utils').deprecate;15var etag = require('./utils').etag;16var statusCodes = http.STATUS_CODES;
66 unmodified lines
8384res.send = function(body){85 var req = this.req;86 var head = 'HEAD' == req.method;87 var type;88 var encoding;89 var len;9091 // settings92 var app = this.app;
46 unmodified lines
139 this.set('ETag', etag(body));140 }141 }142143 // write strings in utf-8144 if ('string' === typeof body) {145 encoding = 'utf8';146 type = this.get('Content-Type');147148 // reflect this in content-type149 if ('string' === typeof type) {150 this.set('Content-Type', setCharset(type, 'utf-8'));151 }152 }153154 // freshness155 if (req.fresh) this.statusCode = 304;156157 // strip irrelevant headers
4 unmodified lines
162 body = '';163 }164165 // respond152 this.end(head ? null : body);166 this.end((head ? null : body), encoding);167168 return this;169};170171/**
647 unmodified lines
modified:lib/utils.js+36 added
7 unmodified lines
8var deprecate = require('util').deprecate;9var proxyaddr = require('proxy-addr');1011/**12 * Simple detection of charset parameter in content-type13 */14var charsetRegExp = /;\s*charset\s*=/;1516/**17 * Deprecate function, like core `util.deprecate`,18 * but with NODE_ENV and color support.19 *20 * @param {Function} fn
170 unmodified lines
191 }192193 return proxyaddr.compile(val || []);194}195196/**197 * Set the charset in a given Content-Type string.198 *199 * @param {String} type200 * @param {String} charset201 * @return {String}202 * @api private203 */204205exports.setCharset = function(type, charset){206 if (!type || !charset) return type;207208 var exists = charsetRegExp.test(type);209210 // removing existing charset211 if (exists) {212 var parts = type.split(';');213214 for (var i = 1; i < parts.length; i++) {215 if (charsetRegExp.test(';' + parts[i])) {216 parts.splice(i, 1);217 break;218 }219 }220221 type = parts.join(';');222 }223224 return type + '; charset=' + charset;225};
modified:test/acceptance/content-negotiation.js+32 added-5 removed
modified:test/acceptance/cookies.js+41 added-2 removed
modified:test/acceptance/mvc.js+51 added-13 removed
5 unmodified lines
6 describe('GET /', function(){7 it('should redirect to /users', function(done){8 request(app)9 .get('/')10 .expect('Location', '/users')11 .expect(302, done)12 })13 })1415 describe('GET /pet/0', function(){16 it('should get pet', function(done){17 request(app)18 .get('/pet/0')19 .expect(200, /Tobi/, done)20 })21 })2223 describe('GET /pet/0/edit', function(){24 it('should get pet edit page', function(done){25 request(app)26 .get('/pet/0/edit')27 .expect(/<form/)28 .expect(200, /Tobi/, done)29 })30 })3132 describe('PUT /pet/2', function(){33 it('should update the pet', function(done){34 request(app)35 .put('/pet/3')36 .send({ pet: { name: 'Boots' } })37 .end(function(err, res){11 res.should.have.status(302);12 res.headers.location.should.include('/users');13 done();38 if (err) return done(err);39 request(app)40 .get('/pet/3/edit')41 .expect(200, /Boots/, done)42 })43 })44 })45
46 unmodified lines
92 describe('GET /user/:id/edit', function(){93 it('should display the edit form', function(done){94 request(app)95 .get('/user/1/edit')68 .end(function(err, res){69 res.text.should.include('<h1>Guillermo</h1>');70 res.text.should.include('value="put"');71 done();72 })96 .expect(/Guillermo/)97 .expect(200, /<form/, done)98 })99 })100101 describe('PUT /user/:id', function(){
1 unmodified line
103 request(app)104 .put('/user/1')105 .send({ user: { name: 'Tobo' }})106 .end(function(err, res){107 if (err) return done(err);108 request(app)109 .get('/user/1/edit')84 .end(function(err, res){85 res.text.should.include('<h1>Tobo</h1>');86 done();87 })110 .expect(200, /Tobo/, done)111 })112 })113 })114115 describe('POST /user/:id/pet', function(){116 it('should create a pet for user', function(done){117 request(app)118 .post('/user/2/pet')119 .send({ pet: { name: 'Snickers' }})120 .expect('Location', '/user/2')121 .expect(302, function(err, res){122 if (err) return done(err)123 request(app)124 .get('/user/2')125 .expect(200, /Snickers/, done)91})126 })127 })128 })129})
modified:test/acceptance/web-service.js+67 added-6 removed
modified:test/app.js+9 added
82 unmodified lines
83 app.enabled('view cache').should.be.true;84 process.env.NODE_ENV = 'test';85 })86})8788describe('without NODE_ENV', function(){89 it('should default to development', function(){90 process.env.NODE_ENV = '';91 var app = express();92 app.get('env').should.equal('development');93 process.env.NODE_ENV = 'test';94 })95})
modified:test/app.param.js+43 added
35 unmodified lines
36 .expect(404, done);37 });3839 })4041 it('should fail if not given fn', function(){42 var app = express();43 app.param.bind(app, ':name', 'bob').should.throw();44 })45 })4647 describe('.param(names, fn)', function(){48 it('should map the array', function(done){
106 unmodified lines
155 request(app)156 .get('/foo/bob')157 .expect('2 2 foo,bob', done);158 })159160 it('should catch thrown error', function(done){161 var app = express();162163 app.param('id', function(req, res, next, id){164 throw new Error('err!');165 });166167 app.get('/user/:id', function(req, res){168 var id = req.params.id;169 res.send('' + id);170 });171172 request(app)173 .get('/user/123')174 .expect(500, done);175 })176177 it('should defer to next route', function(done){178 var app = express();179180 app.param('id', function(req, res, next, id){181 next('route');182 });183184 app.get('/user/:id', function(req, res){185 var id = req.params.id;186 res.send('' + id);187 });188189 app.get('/:name/123', function(req, res){190 res.send('name');191 });192193 request(app)194 .get('/user/123')195 .expect('name', done);196 })197 })198})
modified:test/app.render.js+115 added
52 unmodified lines
53 done();54 })55 })5657 it('should handle render error throws', function(done){58 var app = express();5960 function View(name, options){61 this.name = name;62 this.path = 'fale';63 }6465 View.prototype.render = function(options, fn){66 throw new Error('err!');67 };6869 app.set('view', View);7071 app.render('something', function(err, str){72 err.should.be.ok;73 err.message.should.equal('err!');74 done();75 })76 })7778 describe('when the file does not exist', function(){79 it('should provide a helpful error', function(done){80 var app = express();81 app.set('views', __dirname + '/fixtures');
70 unmodified lines
152 done();153 })154 })155 })156157 describe('caching', function(){158 it('should always lookup view without cache', function(done){159 var app = express();160 var count = 0;161162 function View(name, options){163 this.name = name;164 this.path = 'fake';165 count++;166 }167168 View.prototype.render = function(options, fn){169 fn(null, 'abstract engine');170 };171172 app.set('view cache', false);173 app.set('view', View);174175 app.render('something', function(err, str){176 if (err) return done(err);177 count.should.equal(1);178 str.should.equal('abstract engine');179 app.render('something', function(err, str){180 if (err) return done(err);181 count.should.equal(2);182 str.should.equal('abstract engine');183 done();184 })185 })186 })187188 it('should cache with "view cache" setting', function(done){189 var app = express();190 var count = 0;191192 function View(name, options){193 this.name = name;194 this.path = 'fake';195 count++;196 }197198 View.prototype.render = function(options, fn){199 fn(null, 'abstract engine');200 };201202 app.set('view cache', true);203 app.set('view', View);204205 app.render('something', function(err, str){206 if (err) return done(err);207 count.should.equal(1);208 str.should.equal('abstract engine');209 app.render('something', function(err, str){210 if (err) return done(err);211 count.should.equal(1);212 str.should.equal('abstract engine');213 done();214 })215 })216 })217 })218 })219220 describe('.render(name, options, fn)', function(){221 it('should render the template', function(done){
35 unmodified lines
257 str.should.equal('<p>jane</p>');258 done();259 })260 })261262 describe('caching', function(){263 it('should cache with cache option', function(done){264 var app = express();265 var count = 0;266267 function View(name, options){268 this.name = name;269 this.path = 'fake';270 count++;271 }272273 View.prototype.render = function(options, fn){274 fn(null, 'abstract engine');275 };276277 app.set('view cache', false);278 app.set('view', View);279280 app.render('something', {cache: true}, function(err, str){281 if (err) return done(err);282 count.should.equal(1);283 str.should.equal('abstract engine');284 app.render('something', {cache: true}, function(err, str){285 if (err) return done(err);286 count.should.equal(1);287 str.should.equal('abstract engine');288 done();289 })290 })291 })292 })293 })294})
added:test/req.acceptsEncoding.js+36 added
12var express = require('../')3 , request = require('supertest');45describe('req', function(){6 describe('.acceptsEncodings', function(){7 it('should be true if encoding accpeted', function(done){8 var app = express();910 app.use(function(req, res){11 req.acceptsEncoding('gzip').should.be.ok;12 req.acceptsEncoding('deflate').should.be.ok;13 res.end();14 });1516 request(app)17 .get('/')18 .set('Accept-Encoding', ' gzip, deflate')19 .expect(200, done);20 })2122 it('should be false if encoding not accpeted', function(done){23 var app = express();2425 app.use(function(req, res){26 req.acceptsEncoding('bogus').should.not.be.ok;27 res.end();28 });2930 request(app)31 .get('/')32 .set('Accept-Encoding', ' gzip, deflate')33 .expect(200, done);34 })35 })36})
added:test/req.acceptsLanguage.js+53 added
12var express = require('../')3 , request = require('supertest');45describe('req', function(){6 describe('.acceptsLanguage', function(){7 it('should be true if language accpeted', function(done){8 var app = express();910 app.use(function(req, res){11 req.acceptsLanguage('en-us').should.be.ok;12 req.acceptsLanguage('en').should.be.ok;13 res.end();14 });1516 request(app)17 .get('/')18 .set('Accept-Language', 'en;q=.5, en-us')19 .expect(200, done);20 })2122 it('should be false if language not accpeted', function(done){23 var app = express();2425 app.use(function(req, res){26 req.acceptsLanguage('es').should.not.be.ok;27 res.end();28 });2930 request(app)31 .get('/')32 .set('Accept-Language', 'en;q=.5, en-us')33 .expect(200, done);34 })3536 describe('when Accept-Language is not present', function(){37 it('should always return true', function(done){38 var app = express();3940 app.use(function(req, res){41 req.acceptsLanguage('en').should.be.ok;42 req.acceptsLanguage('es').should.be.ok;43 req.acceptsLanguage('jp').should.be.ok;44 res.end();45 });4647 request(app)48 .get('/')49 .expect(200, done);50 })51 })52 })53})
modified:test/req.range.js+8 added-1 removed
12var assert = require('assert');2var express = require('../');3var express = require('..');45function req(ret) {6 return {7 get: function(){ return ret }
19 unmodified lines
27 var ret = [{ start: 0, end: Infinity }];28 ret.type = 'users';29 req('users=0-').range(Infinity).should.eql(ret);30 })3132 it('should return undefined if no range', function(){33 var ret = [{ start: 0, end: 50 }, { start: 60, end: 100 }];34 ret.type = 'bytes';35 assert(req('').range(120) === undefined);36 })37 })38})
modified:test/res.attachment.js+1 added-1 removed
34 unmodified lines
35 var app = express();3637 app.use(function(req, res){38 res.attachment('/path/to/image.png');39 res.send('foo');39 res.send(new Buffer(4));40 });4142 request(app)43 .get('/')
35 unmodified lines
modified:test/res.json.js+21 added-54 removed
25 unmodified lines
26 });2728 request(app)29 .get('/')30 .expect('Content-Type', 'application/vnd.example+json')30 .expect('Content-Type', 'application/vnd.example+json; charset=utf-8')31 .expect(200, '{"hello":"world"}', done);32 })3334 describe('when given primitives', function(){
5 unmodified lines
40 });4142 request(app)43 .get('/')44 .end(function(err, res){45 res.headers.should.have.property('content-type', 'application/json');46 res.text.should.equal('null');47 done();48 })44 .expect('Content-Type', 'application/json; charset=utf-8')45 .expect(200, 'null', done)46 })4748 it('should respond with json for Number', function(done){49 var app = express();
3 unmodified lines
53 });5455 request(app)56 .get('/')60 .end(function(err, res){61 res.statusCode.should.equal(200);62 res.headers.should.have.property('content-type', 'application/json');63 res.text.should.equal('300');64 done();65 })57 .expect('Content-Type', 'application/json; charset=utf-8')58 .expect(200, '300', done)59 })6061 it('should respond with json for String', function(done){62 var app = express();
3 unmodified lines
66 });6768 request(app)69 .get('/')77 .end(function(err, res){78 res.statusCode.should.equal(200);79 res.headers.should.have.property('content-type', 'application/json');80 res.text.should.equal('"str"');81 done();82 })70 .expect('Content-Type', 'application/json; charset=utf-8')71 .expect(200, '"str"', done)72 })73 })7475 describe('when given an array', function(){
5 unmodified lines
81 });8283 request(app)84 .get('/')96 .end(function(err, res){97 res.headers.should.have.property('content-type', 'application/json');98 res.text.should.equal('["foo","bar","baz"]');99 done();100 })85 .expect('Content-Type', 'application/json; charset=utf-8')86 .expect(200, '["foo","bar","baz"]', done)87 })88 })8990 describe('when given an object', function(){
5 unmodified lines
96 });9798 request(app)99 .get('/')114 .end(function(err, res){115 res.headers.should.have.property('content-type', 'application/json');116 res.text.should.equal('{"name":"tobi"}');117 done();118 })100 .expect('Content-Type', 'application/json; charset=utf-8')101 .expect(200, '{"name":"tobi"}', done)102 })103 })104105 describe('"json replacer" setting', function(){
11 unmodified lines
117 });118119 request(app)120 .get('/')138 .end(function(err, res){139 res.text.should.equal('{"name":"tobi"}');140 done();141 });121 .expect('Content-Type', 'application/json; charset=utf-8')122 .expect(200, '{"name":"tobi"}', done)123 })124 })125126 describe('"json spaces" setting', function(){
12 unmodified lines
139 });140141 request(app)142 .get('/')162 .end(function(err, res){163 res.text.should.equal('{\n "name": "tobi",\n "age": 2\n}');164 done();165 });143 .expect('Content-Type', 'application/json; charset=utf-8')144 .expect(200, '{\n "name": "tobi",\n "age": 2\n}', done)145 })146 })147 })148
6 unmodified lines
155 });156157 request(app)158 .get('/')180 .end(function(err, res){181 res.statusCode.should.equal(201);182 res.headers.should.have.property('content-type', 'application/json');183 res.text.should.equal('{"id":1}');184 done();185 })159 .expect('Content-Type', 'application/json; charset=utf-8')160 .expect(201, '{"id":1}', done)161 })162 })163164 describe('.json(object, status)', function(){
5 unmodified lines
170 });171172 request(app)173 .get('/')199 .end(function(err, res){200 res.statusCode.should.equal(201);201 res.headers.should.have.property('content-type', 'application/json');202 res.text.should.equal('{"id":1}');203 done();204 })174 .expect('Content-Type', 'application/json; charset=utf-8')175 .expect(201, '{"id":1}', done)176 })177178 it('should use status as second number for backwards compat', function(done){179 var app = express();
3 unmodified lines
183 });184185 request(app)186 .get('/')216 .end(function(err, res){217 res.statusCode.should.equal(201);218 res.headers.should.have.property('content-type', 'application/json');219 res.text.should.equal('200');220 done();221 })187 .expect('Content-Type', 'application/json; charset=utf-8')188 .expect(201, '200', done)189 })190 })191})
modified:test/res.jsonp.js+39 added-64 removed
44 unmodified lines
45 });4647 request(app)48 .get('/?callback[a]=something')49 .end(function(err, res){50 res.headers.should.have.property('content-type', 'application/json');51 res.text.should.equal('{"count":1}');52 done();53 })49 .expect('Content-Type', 'application/json; charset=utf-8')50 .expect(200, '{"count":1}', done)51 })5253 it('should allow renaming callback', function(done){54 var app = express();
70 unmodified lines
125 });126127 request(app)128 .get('/')132 .expect('Content-Type', 'application/vnd.example+json')129 .expect('Content-Type', 'application/vnd.example+json; charset=utf-8')130 .expect(200, '{"hello":"world"}', done);131 })132133 it('should override previous Content-Types with callback', function(done){
19 unmodified lines
153 });154155 request(app)156 .get('/')160 .end(function(err, res){161 res.headers.should.have.property('content-type', 'application/json');162 res.text.should.equal('null');163 done();164 })157 .expect('Content-Type', 'application/json; charset=utf-8')158 .expect(200, 'null', done)159 })160 })161162 describe('when given an array', function(){
5 unmodified lines
168 });169170 request(app)171 .get('/')178 .end(function(err, res){179 res.headers.should.have.property('content-type', 'application/json');180 res.text.should.equal('["foo","bar","baz"]');181 done();182 })172 .expect('Content-Type', 'application/json; charset=utf-8')173 .expect(200, '["foo","bar","baz"]', done)174 })175 })176177 describe('when given an object', function(){
5 unmodified lines
183 });184185 request(app)186 .get('/')196 .end(function(err, res){197 res.headers.should.have.property('content-type', 'application/json');198 res.text.should.equal('{"name":"tobi"}');199 done();200 })187 .expect('Content-Type', 'application/json; charset=utf-8')188 .expect(200, '{"name":"tobi"}', done)189 })190 })191192 describe('when given primitives', function(){
5 unmodified lines
198 });199200 request(app)201 .get('/')214 .end(function(err, res){215 res.headers.should.have.property('content-type', 'application/json');216 res.text.should.equal('null');217 done();218 })202 .expect('Content-Type', 'application/json; charset=utf-8')203 .expect(200, 'null', done)204 })205206 it('should respond with json for Number', function(done){207 var app = express();
3 unmodified lines
211 });212213 request(app)214 .get('/')230 .end(function(err, res){231 res.statusCode.should.equal(200);232 res.headers.should.have.property('content-type', 'application/json');233 res.text.should.equal('300');234 done();235 })215 .expect('Content-Type', 'application/json; charset=utf-8')216 .expect(200, '300', done)217 })218219 it('should respond with json for String', function(done){220 var app = express();
3 unmodified lines
224 });225226 request(app)227 .get('/')247 .end(function(err, res){248 res.statusCode.should.equal(200);249 res.headers.should.have.property('content-type', 'application/json');250 res.text.should.equal('"str"');251 done();252 })228 .expect('Content-Type', 'application/json; charset=utf-8')229 .expect(200, '"str"', done)230 })231 })232233 describe('"json replacer" setting', function(){
11 unmodified lines
245 });246247 request(app)248 .get('/')272 .end(function(err, res){273 res.text.should.equal('{"name":"tobi"}');274 done();275 });249 .expect('Content-Type', 'application/json; charset=utf-8')250 .expect(200, '{"name":"tobi"}', done)251 })252 })253254 describe('"json spaces" setting', function(){
12 unmodified lines
267 });268269 request(app)270 .get('/')296 .end(function(err, res){297 res.text.should.equal('{\n "name": "tobi",\n "age": 2\n}');298 done();299 });271 .expect('Content-Type', 'application/json; charset=utf-8')272 .expect(200, '{\n "name": "tobi",\n "age": 2\n}', done)273 })274 })275 })276
6 unmodified lines
283 });284285 request(app)286 .get('/')314 .end(function(err, res){315 res.statusCode.should.equal(201);316 res.headers.should.have.property('content-type', 'application/json');317 res.text.should.equal('{"id":1}');318 done();319 })287 .expect('Content-Type', 'application/json; charset=utf-8')288 .expect(201, '{"id":1}', done)289 })290 })291292 describe('.jsonp(object, status)', function(){
5 unmodified lines
298 });299300 request(app)301 .get('/')333 .end(function(err, res){334 res.statusCode.should.equal(201);335 res.headers.should.have.property('content-type', 'application/json');336 res.text.should.equal('{"id":1}');337 done();338 })302 .expect('Content-Type', 'application/json; charset=utf-8')303 .expect(201, '{"id":1}', done)304 })305306 it('should use status as second number for backwards compat', function(done){307 var app = express();
3 unmodified lines
311 });312313 request(app)314 .get('/')350 .end(function(err, res){351 res.statusCode.should.equal(201);352 res.headers.should.have.property('content-type', 'application/json');353 res.text.should.equal('200');354 done();355 })315 .expect('Content-Type', 'application/json; charset=utf-8')316 .expect(201, '200', done)317 })318 })319320 it('should not override previous Content-Types', function(done){321 var app = express();322323 app.get('/', function(req, res){324 res.type('application/vnd.example+json');325 res.jsonp({ hello: 'world' });326 });327328 request(app)329 .get('/')330 .expect('content-type', 'application/vnd.example+json; charset=utf-8')331 .expect(200, '{"hello":"world"}', done)332 })333})
modified:test/res.send.js+29 added-7 removed
138 unmodified lines
139140 request(app)141 .get('/')142 .expect('Content-Type', 'text/plain; charset=utf-8')143 .expect('hey')144 .expect(200, done);143 .expect(200, 'hey', done);144 })145146 it('should override charset in Content-Type', function(done){147 var app = express();148149 app.use(function(req, res){150 res.set('Content-Type', 'text/plain; charset=iso-8859-1').send('hey');151 });152153 request(app)154 .get('/')155 .expect('Content-Type', 'text/plain; charset=utf-8')156 .expect(200, 'hey', done);157 })158159 it('should keep charset in Content-Type for Buffers', function(done){160 var app = express();161162 app.use(function(req, res){163 res.set('Content-Type', 'text/plain; charset=iso-8859-1').send(new Buffer('hi'));164 });165166 request(app)167 .get('/')168 .expect('Content-Type', 'text/plain; charset=iso-8859-1')169 .expect(200, 'hi', done);170 })171 })172173 describe('.send(Buffer)', function(){174 it('should send as octet-stream', function(done){
54 unmodified lines
229 });230231 request(app)232 .get('/')208 .end(function(err, res){209 res.headers.should.have.property('content-type', 'application/json');210 res.text.should.equal('{"name":"tobi"}');211 done();212 })233 .expect('Content-Type', 'application/json; charset=utf-8')234 .expect(200, '{"name":"tobi"}', done)235 })236 })237238 describe('when the request method is HEAD', function(){
182 unmodified lines
modified:.travis.yml+1 added
5 unmodified lines
6 allow_failures:7 - node_js: "0.11"8 fast_finish: true9script: "npm run-script test-travis"10after_script: "npm install coveralls@2.10.0 && cat ./coverage/lcov.info | coveralls"
modified:History.md+12 added
11 unmodified lines
12 - `app.set('trust proxy', '10.0.0.1/16')` trust subnet13 - `app.set('trust proxy', '10.0.0.1, 10.0.0.2')` trust list14 - `app.set('trust proxy', false)` turn off15 - `app.set('trust proxy', true)` trust everything16 * set proper `charset` in `Content-Type` for `res.send`17 * update type-is to 1.2.018 - support suffix matching19204.2.0 / 2014-05-11
91 unmodified lines
112 - `app.router()` - returns the app Router instance113 - `app.route()` - Proxy to the app's `Router#route()` method to create a new route114 - Router & Route - public API1151163.8.0 / 2014-05-21117==================118119 * keep previous `Content-Type` for `res.jsonp`120 * set proper `charset` in `Content-Type` for `res.send`121 * update connect to 2.17.1122 - fix `res.charset` appending charset when `content-type` has one123 - deps: express-session@1.2.0124 - deps: morgan@1.1.1125 - deps: serve-index@1.0.31261273.7.0 / 2014-05-18128==================129130 * proper proxy trust with `app.set('trust proxy', trust)`
1335 unmodified lines
modified:package.json+2 added-3 removed
66 unmodified lines
67 "debug": "0.8.1"68 },69 "devDependencies": {70 "after": "0.8.1",71 "coveralls": "2.10.0",71 "istanbul": "0.2.10",73 "mocha": "~1.18.2",72 "mocha": "~1.19.0",73 "should": "~3.3.1",74 "supertest": "~0.12.0",75 "connect-redis": "~2.0.0",76 "ejs": "~1.0.0",
14 unmodified lines
91 "scripts": {92 "prepublish": "npm prune",93 "test": "mocha --require test/support/env --reporter dot --check-leaks test/ test/acceptance/",94 "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/",96 "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/ && (cat ./coverage/lcov.info | coveralls || true)"95 "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/"96 }97}