Skip to content
Myr

req.acceptsEncodings.js

This file

Path

test/req.acceptsEncodings.js

39 lines · 953 bytes · JavaScript

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than 2027b87 point at it.

fix(deps): cookie@0.7.0Josh Bukerbefore adoption2027b87

lines 1–39why, one step back
1'use strict'
23var express = require('../')4 , request = require('supertest');56describe('req', function(){7 describe('.acceptsEncodings', function () {8 it('should return encoding if accepted', function (done) {9 var app = express();1011 app.get('/', function (req, res) {12 res.send({13 gzip: req.acceptsEncodings('gzip'),14 deflate: req.acceptsEncodings('deflate')15 })16 })1718 request(app)19 .get('/')20 .set('Accept-Encoding', ' gzip, deflate')21 .expect(200, { gzip: 'gzip', deflate: 'deflate' }, done)22 })2324 it('should be false if encoding not accepted', function(done){25 var app = express();2627 app.get('/', function (req, res) {28 res.send({29 bogus: req.acceptsEncodings('bogus')30 })31 })3233 request(app)34 .get('/')35 .set('Accept-Encoding', ' gzip, deflate')36 .expect(200, { bogus: false }, done)37 })38 })39})