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 fileTake it
The walk stopped after 200 commits: lines older than 55831bb point at it.
tests: use strict modeDouglas Christopher Wilsonbefore adoptiona659137
line 1why, one step back1'use strict'build: Node.js@10.18Douglas Christopher Wilsonbefore adoption55831bb
lines 2–7why, one step back23var 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 back8 it('should return encoding if accepted', function (done) {build: Node.js@10.18Douglas Christopher Wilsonbefore adoption55831bb
lines 9–10why, one step back9 var app = express();10tests: fix wording of req.accepts* test casesDouglas Christopher Wilsonbefore adoption215f484
lines 11–16why, one step back11 app.get('/', function (req, res) {12 res.send({13 gzip: req.acceptsEncoding('gzip'),14 deflate: req.acceptsEncoding('deflate')15 })16 })build: Node.js@10.18Douglas Christopher Wilsonbefore adoption55831bb
lines 17–18why, one step back1718 request(app)tests: fix wording of req.accepts* test casesDouglas Christopher Wilsonbefore adoption215f484
lines 19–21why, one step back19 .get('/')20 .set('Accept-Encoding', ' gzip, deflate')21 .expect(200, { gzip: 'gzip', deflate: 'deflate' }, done)build: Node.js@10.18Douglas Christopher Wilsonbefore adoption55831bb
lines 22–26why, one step back22 })2324 it('should be false if encoding not accepted', function(done){25 var app = express();26tests: fix wording of req.accepts* test casesDouglas Christopher Wilsonbefore adoption215f484
lines 27–31why, one step back27 app.get('/', function (req, res) {28 res.send({29 bogus: req.acceptsEncoding('bogus')30 })31 })build: Node.js@10.18Douglas Christopher Wilsonbefore adoption55831bb
lines 32–33why, one step back3233 request(app)tests: fix wording of req.accepts* test casesDouglas Christopher Wilsonbefore adoption215f484
lines 34–36why, one step back34 .get('/')35 .set('Accept-Encoding', ' gzip, deflate')36 .expect(200, { bogus: false }, done)build: Node.js@10.18Douglas Christopher Wilsonbefore adoption55831bb
lines 37–39why, one step back37 })38 })39})