mirror of
https://github.com/zebrajr/express.git
synced 2025-12-06 00:19:48 +01:00
config test
This commit is contained in:
parent
8a91749e12
commit
51a5c829bb
41
test/config.js
Normal file
41
test/config.js
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
var express = require('../')
|
||||
, assert = require('assert');
|
||||
|
||||
describe('config', function(){
|
||||
describe('.set()', function(){
|
||||
it('should set a value', function(){
|
||||
var app = express();
|
||||
app.set('foo', 'bar').should.equal(app);
|
||||
})
|
||||
})
|
||||
|
||||
describe('.get()', function(){
|
||||
it('should return undefined when unset', function(){
|
||||
var app = express();
|
||||
assert(undefined === app.get('foo'));
|
||||
})
|
||||
|
||||
it('should otherwise return the value', function(){
|
||||
var app = express();
|
||||
app.set('foo', 'bar');
|
||||
app.get('foo').should.equal('bar');
|
||||
})
|
||||
})
|
||||
|
||||
describe('.enable()', function(){
|
||||
it('should set the value to true', function(){
|
||||
var app = express();
|
||||
app.enable('tobi').should.equal(app);
|
||||
app.get('tobi').should.be.true;
|
||||
})
|
||||
})
|
||||
|
||||
describe('.disable()', function(){
|
||||
it('should set the value to false', function(){
|
||||
var app = express();
|
||||
app.disable('tobi').should.equal(app);
|
||||
app.get('tobi').should.be.false;
|
||||
})
|
||||
})
|
||||
})
|
||||
21
test/exports.js
Normal file
21
test/exports.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
var express = require('../');
|
||||
|
||||
describe('exports', function(){
|
||||
it('should have .version', function(){
|
||||
express.should.have.property('version');
|
||||
})
|
||||
|
||||
it('should expose connect middleware', function(){
|
||||
express.should.have.property('bodyParser');
|
||||
express.should.have.property('session');
|
||||
express.should.have.property('static');
|
||||
})
|
||||
|
||||
it('should expose HTTP methods', function(){
|
||||
express.methods.should.be.an.instanceof(Array);
|
||||
express.methods.should.contain('get');
|
||||
express.methods.should.contain('put');
|
||||
express.methods.should.contain('post');
|
||||
})
|
||||
})
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
|
||||
var express = require('../');
|
||||
|
||||
describe('express', function(){
|
||||
describe('exports', function(){
|
||||
it('should have .version', function(){
|
||||
express.should.have.property('version');
|
||||
})
|
||||
|
||||
it('should expose connect middleware', function(){
|
||||
express.should.have.property('bodyParser');
|
||||
express.should.have.property('session');
|
||||
express.should.have.property('static');
|
||||
})
|
||||
|
||||
it('should expose HTTP methods', function(){
|
||||
express.methods.should.be.an.instanceof(Array);
|
||||
express.methods.should.contain('get');
|
||||
express.methods.should.contain('put');
|
||||
express.methods.should.contain('post');
|
||||
})
|
||||
})
|
||||
})
|
||||
Loading…
Reference in New Issue
Block a user