req.acceptedEncodings.js
This file
Path
test/req.acceptedEncodings.js
37 lines · 878 bytes · JavaScript
Last changed by
remove unnecessary test/support/httpJonathan Ongbefore adoption328c6d3
History of this fileTake it
The walk stopped after 200 commits: lines older than a10f695 point at it.
pin jade dev dep so tests do not breakTJ Holowaychukbefore adoptiona10f695
lines 1–2why, one step back12var express = require('../')remove unnecessary test/support/httpJonathan Ongbefore adoption328c6d3
line 3why, one step back3 , request = require('supertest');pin jade dev dep so tests do not breakTJ Holowaychukbefore adoptiona10f695
lines 4–31why, one step back45describe('req', function(){6 describe('.acceptedEncodings', function(){7 it('should return an array of accepted encodings', function(done){8 var app = express();910 app.use(function(req, res){11 req.acceptedEncodings.should.eql(['gzip', 'deflate']);12 res.end();13 });1415 request(app)16 .get('/')17 .set('Accept-Encoding', ' gzip, deflate')18 .expect(200, done);19 })2021 describe('when Accept-Encoding is not present', function(){22 it('should default to []', function(done){23 var app = express();2425 app.use(function(req, res){26 req.acceptedEncodings.should.have.length(0);27 res.end();28 });2930 request(app)31 .get('/')bump supertest to 0.8.1Jonathan Ongbefore adoption1826440
line 32why, one step back32 .set('Accept-Encoding', '')pin jade dev dep so tests do not breakTJ Holowaychukbefore adoptiona10f695
lines 33–37why, one step back33 .expect(200, done);34 })35 })36 })37})