Skip to content
Myr

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 file

Take 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 back
1'use strict'

4.7.2Douglas Christopher Wilsonbefore adoption1854a5d

lines 2–6why, one step back
2
3var express = require('../')4 , request = require('supertest');56describe('req', function(){

Merge tag '4.17.1'Douglas Christopher Wilsonbefore adoption121fe99

line 7why, one step back
7 describe('.acceptsEncodings', function () {

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 8why, one step back
8 it('should return encoding if accepted', function (done) {

4.7.2Douglas Christopher Wilsonbefore adoption1854a5d

lines 9–10why, one step back
9 var app = express();
10

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 11–16why, one step back
11 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 back
17
18 request(app)

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 19–21why, one step back
19 .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 back
22 })
23

Merge tag '4.14.1'Douglas Christopher Wilsonbefore adoptionbcbb9d5

line 24why, one step back
24 it('should be false if encoding not accepted', function(done){

4.7.2Douglas Christopher Wilsonbefore adoption1854a5d

lines 25–26why, one step back
25 var app = express();
26

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 27–31why, one step back
27 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 back
32
33 request(app)

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 34–36why, one step back
34 .get('/')
35 .set('Accept-Encoding', ' gzip, deflate')36 .expect(200, { bogus: false }, done)

4.7.2Douglas Christopher Wilsonbefore adoption1854a5d

lines 37–39why, one step back
37 })
38 })39})