Skip to content
Myr

req.acceptsEncoding.js

This file

Path

test/req.acceptsEncoding.js

38 lines · 934 bytes · JavaScript

Last changed by

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

History of this file

Take it

The walk stopped after 200 commits: lines older than 276a808 point at it.

deps: send@0.16.2Douglas Christopher Wilsonbefore adoption276a808

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

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

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

deps: send@0.16.2Douglas Christopher Wilsonbefore adoption276a808

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

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

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

deps: send@0.16.2Douglas Christopher Wilsonbefore adoption276a808

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

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

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

deps: send@0.16.2Douglas Christopher Wilsonbefore adoption276a808

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

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

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

deps: send@0.16.2Douglas Christopher Wilsonbefore adoption276a808

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

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

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

deps: send@0.16.2Douglas Christopher Wilsonbefore adoption276a808

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