req.acceptsEncodings.js
This file
Path
test/req.acceptsEncodings.js
39 lines · 953 bytes · JavaScript
Last changed by
Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b
History of this fileTake it
The walk stopped after 200 commits: lines older than 1854a5d point at it.
Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b
line 1why, one step back1'use strict'4.7.2Douglas Christopher Wilsonbefore adoption1854a5d
lines 2–6why, one step back23var express = require('../')4 , request = require('supertest');56describe('req', function(){Merge tag '4.17.1'Douglas Christopher Wilsonbefore adoption121fe99
line 7why, one step back7 describe('.acceptsEncodings', function () {Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b
line 8why, one step back8 it('should return encoding if accepted', function (done) {4.7.2Douglas Christopher Wilsonbefore adoption1854a5d
lines 9–10why, one step back9 var app = express();10Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b
lines 11–16why, one step back11 app.get('/', function (req, res) {12 res.send({13 gzip: req.acceptsEncodings('gzip'),14 deflate: req.acceptsEncodings('deflate')15 })16 })4.7.2Douglas Christopher Wilsonbefore adoption1854a5d
lines 17–18why, one step back1718 request(app)Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b
lines 19–21why, one step back19 .get('/')20 .set('Accept-Encoding', ' gzip, deflate')21 .expect(200, { gzip: 'gzip', deflate: 'deflate' }, done)4.7.2Douglas Christopher Wilsonbefore adoption1854a5d
lines 22–23why, one step back22 })23Merge tag '4.14.1'Douglas Christopher Wilsonbefore adoptionbcbb9d5
line 24why, one step back24 it('should be false if encoding not accepted', function(done){4.7.2Douglas Christopher Wilsonbefore adoption1854a5d
lines 25–26why, one step back25 var app = express();26Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b
lines 27–31why, one step back27 app.get('/', function (req, res) {28 res.send({29 bogus: req.acceptsEncodings('bogus')30 })31 })4.7.2Douglas Christopher Wilsonbefore adoption1854a5d
lines 32–33why, one step back3233 request(app)Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b
lines 34–36why, one step back34 .get('/')35 .set('Accept-Encoding', ' gzip, deflate')36 .expect(200, { bogus: false }, done)4.7.2Douglas Christopher Wilsonbefore adoption1854a5d
lines 37–39why, one step back37 })38 })39})