Skip to content
Myr

req.acceptsEncoding.js

This file

Path

test/req.acceptsEncoding.js

39 lines · 947 bytes · JavaScript

Last changed by

tests: use strict modeDouglas Christopher Wilsonbefore adoptiona659137

History of this file

Take it

The walk stopped after 200 commits: lines older than 5e9de5d point at it.

tests: use strict modeDouglas Christopher Wilsonbefore adoptiona659137

line 1why, one step back
1'use strict'

deps: safe-buffer@5.1.2Douglas Christopher Wilsonbefore adoption5e9de5d

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

tests: fix wording of req.accepts* test casesDouglas Christopher Wilsonbefore adoption215f484

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

deps: safe-buffer@5.1.2Douglas Christopher Wilsonbefore adoption5e9de5d

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

tests: fix wording of req.accepts* test casesDouglas Christopher Wilsonbefore adoption215f484

lines 11–16why, one step back
11 app.get('/', function (req, res) {
12 res.send({13 gzip: req.acceptsEncoding('gzip'),14 deflate: req.acceptsEncoding('deflate')15 })16 })

deps: safe-buffer@5.1.2Douglas Christopher Wilsonbefore adoption5e9de5d

lines 17–18why, one step back
17
18 request(app)

tests: fix wording of req.accepts* test casesDouglas Christopher Wilsonbefore adoption215f484

lines 19–21why, one step back
19 .get('/')
20 .set('Accept-Encoding', ' gzip, deflate')21 .expect(200, { gzip: 'gzip', deflate: 'deflate' }, done)

deps: safe-buffer@5.1.2Douglas Christopher Wilsonbefore adoption5e9de5d

lines 22–26why, one step back
22 })
2324 it('should be false if encoding not accepted', function(done){25 var app = express();26

tests: fix wording of req.accepts* test casesDouglas Christopher Wilsonbefore adoption215f484

lines 27–31why, one step back
27 app.get('/', function (req, res) {
28 res.send({29 bogus: req.acceptsEncoding('bogus')30 })31 })

deps: safe-buffer@5.1.2Douglas Christopher Wilsonbefore adoption5e9de5d

lines 32–33why, one step back
32
33 request(app)

tests: fix wording of req.accepts* test casesDouglas Christopher Wilsonbefore adoption215f484

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

deps: safe-buffer@5.1.2Douglas Christopher Wilsonbefore adoption5e9de5d

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