req.acceptsEncodings.js
This file
Path
test/req.acceptsEncodings.js
36 lines · 859 bytes · JavaScript
Last changed by
tests: fix typos in descriptions김정환before adoptionb9b1b19
History of this fileTake it
The walk stopped after 200 commits: lines older than fa272ed point at it.
docs: fix typo in jsdoc commentHrvoje Šimićbefore adoptionfa272ed
lines 1–5why, one step back12var express = require('../')3 , request = require('supertest');45describe('req', function(){tests: fix typos in descriptions김정환before adoptionb9b1b19
line 6why, one step back6 describe('.acceptsEncodings', function () {docs: fix typo in jsdoc commentHrvoje Šimićbefore adoptionfa272ed
lines 7–36why, one step back7 it('should be true if encoding accepted', function(done){8 var app = express();910 app.use(function(req, res){11 req.acceptsEncodings('gzip').should.be.ok()12 req.acceptsEncodings('deflate').should.be.ok()13 res.end();14 });1516 request(app)17 .get('/')18 .set('Accept-Encoding', ' gzip, deflate')19 .expect(200, done);20 })2122 it('should be false if encoding not accepted', function(done){23 var app = express();2425 app.use(function(req, res){26 req.acceptsEncodings('bogus').should.not.be.ok()27 res.end();28 });2930 request(app)31 .get('/')32 .set('Accept-Encoding', ' gzip, deflate')33 .expect(200, done);34 })35 })36})