req.acceptsEncodings.js
This file
Path
test/req.acceptsEncodings.js
36 lines · 859 bytes · JavaScript
Last changed by
Merge tag '4.17.1'Douglas Christopher Wilsonbefore adoption121fe99
History of this fileTake it
The walk stopped after 200 commits: lines older than 9019424 point at it.
deps: depd@0.4.2Douglas Christopher Wilsonbefore adoption9019424
lines 1–5why, one step back12var express = require('../')3 , request = require('supertest');45describe('req', function(){Merge tag '4.17.1'Douglas Christopher Wilsonbefore adoption121fe99
line 6why, one step back6 describe('.acceptsEncodings', function () {Merge tag '4.14.1'Douglas Christopher Wilsonbefore adoptionbcbb9d5
line 7why, one step back7 it('should be true if encoding accepted', function(done){deps: depd@0.4.2Douglas Christopher Wilsonbefore adoption9019424
lines 8–10why, one step back8 var app = express();910 app.use(function(req, res){Merge tag '4.15.4'Douglas Christopher Wilsonbefore adoptionc319fe2
lines 11–12why, one step back11 req.acceptsEncodings('gzip').should.be.ok()12 req.acceptsEncodings('deflate').should.be.ok()deps: depd@0.4.2Douglas Christopher Wilsonbefore adoption9019424
lines 13–21why, one step back13 res.end();14 });1516 request(app)17 .get('/')18 .set('Accept-Encoding', ' gzip, deflate')19 .expect(200, done);20 })21Merge tag '4.14.1'Douglas Christopher Wilsonbefore adoptionbcbb9d5
line 22why, one step back22 it('should be false if encoding not accepted', function(done){deps: depd@0.4.2Douglas Christopher Wilsonbefore adoption9019424
lines 23–25why, one step back23 var app = express();2425 app.use(function(req, res){Merge tag '4.15.4'Douglas Christopher Wilsonbefore adoptionc319fe2
line 26why, one step back26 req.acceptsEncodings('bogus').should.not.be.ok()deps: depd@0.4.2Douglas Christopher Wilsonbefore adoption9019424
lines 27–36why, one step back27 res.end();28 });2930 request(app)31 .get('/')32 .set('Accept-Encoding', ' gzip, deflate')33 .expect(200, done);34 })35 })36})