Skip to content
Myr

req.acceptsLanguage.js

This file

Path

test/req.acceptsLanguage.js

53 lines · 1.3 KiB · JavaScript

Last changed by

tests: fix incorrect should usageDaniel Walasekbefore adoption713d2ae

History of this file

Take it

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

examples: comment the usage of process.nextTickMuhammad Saqibbefore adoptiondd2b897

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

tests: fix typos in test descriptionsVishvajit Pathakbefore adoptionbd47aeb

line 7why, one step back
7 it('should be true if language accepted', function(done){

examples: comment the usage of process.nextTickMuhammad Saqibbefore adoptiondd2b897

lines 8–10why, one step back
8 var app = express();
910 app.use(function(req, res){

tests: fix incorrect should usageDaniel Walasekbefore adoption713d2ae

lines 11–12why, one step back
11 req.acceptsLanguage('en-us').should.be.ok()
12 req.acceptsLanguage('en').should.be.ok()

examples: comment the usage of process.nextTickMuhammad Saqibbefore adoptiondd2b897

lines 13–21why, one step back
13 res.end();
14 });1516 request(app)17 .get('/')18 .set('Accept-Language', 'en;q=.5, en-us')19 .expect(200, done);20 })21

tests: fix typos in test descriptionsVishvajit Pathakbefore adoptionbd47aeb

line 22why, one step back
22 it('should be false if language not accepted', function(done){

examples: comment the usage of process.nextTickMuhammad Saqibbefore adoptiondd2b897

lines 23–25why, one step back
23 var app = express();
2425 app.use(function(req, res){

tests: fix incorrect should usageDaniel Walasekbefore adoption713d2ae

line 26why, one step back
26 req.acceptsLanguage('es').should.not.be.ok()

examples: comment the usage of process.nextTickMuhammad Saqibbefore adoptiondd2b897

lines 27–40why, one step back
27 res.end();
28 });2930 request(app)31 .get('/')32 .set('Accept-Language', 'en;q=.5, en-us')33 .expect(200, done);34 })3536 describe('when Accept-Language is not present', function(){37 it('should always return true', function(done){38 var app = express();3940 app.use(function(req, res){

tests: fix incorrect should usageDaniel Walasekbefore adoption713d2ae

lines 41–43why, one step back
41 req.acceptsLanguage('en').should.be.ok()
42 req.acceptsLanguage('es').should.be.ok()43 req.acceptsLanguage('jp').should.be.ok()

examples: comment the usage of process.nextTickMuhammad Saqibbefore adoptiondd2b897

lines 44–53why, one step back
44 res.end();
45 });4647 request(app)48 .get('/')49 .expect(200, done);50 })51 })52 })53})