Skip to content

Commit

Permalink
tests: fix incorrect should usage
Browse files Browse the repository at this point in the history
closes #3387
  • Loading branch information
Lysander6 authored and dougwilson committed Aug 6, 2017
1 parent e0aa8bf commit 713d2ae
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 51 deletions.
14 changes: 7 additions & 7 deletions test/Route.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Route', function(){

route.dispatch(req, {}, function (err) {
if (err) return done(err);
should(req.called).be.ok;
should(req.called).be.ok()
done();
});
})
Expand Down Expand Up @@ -84,7 +84,7 @@ describe('Route', function(){

route.dispatch(req, {}, function (err) {
if (err) return done(err);
should(req.called).be.ok;
should(req.called).be.ok()
done();
});
})
Expand All @@ -104,7 +104,7 @@ describe('Route', function(){

route.dispatch(req, {}, function (err) {
if (err) return done(err);
should(req.called).be.true;
should(req.called).be.true()
done();
});
})
Expand Down Expand Up @@ -156,7 +156,7 @@ describe('Route', function(){
});

route.dispatch(req, {}, function (err) {
should(err).be.ok;
should(err).be.ok()
should(err.message).equal('foobar');
req.order.should.equal('a');
done();
Expand All @@ -182,7 +182,7 @@ describe('Route', function(){
});

route.dispatch(req, {}, function (err) {
should(err).be.ok;
should(err).be.ok()
should(err.message).equal('foobar');
req.order.should.equal('a');
done();
Expand Down Expand Up @@ -222,7 +222,7 @@ describe('Route', function(){
});

route.dispatch(req, {}, function(err){
should(err).be.ok;
should(err).be.ok()
err.message.should.equal('boom!');
done();
});
Expand All @@ -234,7 +234,7 @@ describe('Route', function(){

route.all(function(err, req, res, next){
// this should not execute
true.should.be.false;
true.should.be.false()
});

route.dispatch(req, {}, done);
Expand Down
2 changes: 1 addition & 1 deletion test/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Router', function(){
var router = new Router();

router.use(function (req, res) {
false.should.be.true;
false.should.be.true()
});

router.handle({ url: '', method: 'GET' }, {}, done);
Expand Down
4 changes: 2 additions & 2 deletions test/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('in development', function(){
it('should disable "view cache"', function(){
process.env.NODE_ENV = 'development';
var app = express();
app.enabled('view cache').should.be.false;
app.enabled('view cache').should.be.false()
process.env.NODE_ENV = 'test';
})
})
Expand All @@ -95,7 +95,7 @@ describe('in production', function(){
it('should enable "view cache"', function(){
process.env.NODE_ENV = 'production';
var app = express();
app.enabled('view cache').should.be.true;
app.enabled('view cache').should.be.true()
process.env.NODE_ENV = 'test';
})
})
Expand Down
6 changes: 3 additions & 3 deletions test/app.param.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ describe('app', function(){

app.get('/post/:id', function(req, res){
var id = req.params.id;
id.should.be.a.Number;
id.should.be.a.Number()
res.send('' + id);
});

app.get('/user/:uid', function(req, res){
var id = req.params.id;
id.should.be.a.Number;
id.should.be.a.Number()
res.send('' + id);
});

Expand Down Expand Up @@ -91,7 +91,7 @@ describe('app', function(){

app.get('/user/:id', function(req, res){
var id = req.params.id;
id.should.be.a.Number;
id.should.be.a.Number()
res.send('' + id);
});

Expand Down
2 changes: 1 addition & 1 deletion test/app.render.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('app', function(){
app.set('view', View);

app.render('something', function(err, str){
err.should.be.ok;
err.should.be.ok()
err.message.should.equal('err!');
done();
})
Expand Down
8 changes: 4 additions & 4 deletions test/app.routes.error.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ describe('app', function(){
d = true;
next();
}, function(req, res){
a.should.be.false;
b.should.be.true;
c.should.be.true;
d.should.be.false;
a.should.be.false()
b.should.be.true()
c.should.be.true()
d.should.be.false()
res.send(204);
});

Expand Down
8 changes: 4 additions & 4 deletions test/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ var should = require('should');

describe('exports', function(){
it('should expose Router', function(){
express.Router.should.be.a.Function;
express.Router.should.be.a.Function()
})

it('should expose the application prototype', function(){
express.application.set.should.be.a.Function;
express.application.set.should.be.a.Function()
})

it('should expose the request prototype', function(){
express.request.accepts.should.be.a.Function;
express.request.accepts.should.be.a.Function()
})

it('should expose the response prototype', function(){
express.response.send.should.be.a.Function;
express.response.send.should.be.a.Function()
})

it('should permit modifying the .application prototype', function(){
Expand Down
6 changes: 3 additions & 3 deletions test/req.acceptsEncoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ describe('req', function(){
var app = express();

app.use(function(req, res){
req.acceptsEncoding('gzip').should.be.ok;
req.acceptsEncoding('deflate').should.be.ok;
req.acceptsEncoding('gzip').should.be.ok()
req.acceptsEncoding('deflate').should.be.ok()
res.end();
});

Expand All @@ -23,7 +23,7 @@ describe('req', function(){
var app = express();

app.use(function(req, res){
req.acceptsEncoding('bogus').should.not.be.ok;
req.acceptsEncoding('bogus').should.not.be.ok()
res.end();
});

Expand Down
6 changes: 3 additions & 3 deletions test/req.acceptsEncodings.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ describe('req', function(){
var app = express();

app.use(function(req, res){
req.acceptsEncodings('gzip').should.be.ok;
req.acceptsEncodings('deflate').should.be.ok;
req.acceptsEncodings('gzip').should.be.ok()
req.acceptsEncodings('deflate').should.be.ok()
res.end();
});

Expand All @@ -23,7 +23,7 @@ describe('req', function(){
var app = express();

app.use(function(req, res){
req.acceptsEncodings('bogus').should.not.be.ok;
req.acceptsEncodings('bogus').should.not.be.ok()
res.end();
});

Expand Down
12 changes: 6 additions & 6 deletions test/req.acceptsLanguage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ describe('req', function(){
var app = express();

app.use(function(req, res){
req.acceptsLanguage('en-us').should.be.ok;
req.acceptsLanguage('en').should.be.ok;
req.acceptsLanguage('en-us').should.be.ok()
req.acceptsLanguage('en').should.be.ok()
res.end();
});

Expand All @@ -23,7 +23,7 @@ describe('req', function(){
var app = express();

app.use(function(req, res){
req.acceptsLanguage('es').should.not.be.ok;
req.acceptsLanguage('es').should.not.be.ok()
res.end();
});

Expand All @@ -38,9 +38,9 @@ describe('req', function(){
var app = express();

app.use(function(req, res){
req.acceptsLanguage('en').should.be.ok;
req.acceptsLanguage('es').should.be.ok;
req.acceptsLanguage('jp').should.be.ok;
req.acceptsLanguage('en').should.be.ok()
req.acceptsLanguage('es').should.be.ok()
req.acceptsLanguage('jp').should.be.ok()
res.end();
});

Expand Down
12 changes: 6 additions & 6 deletions test/req.acceptsLanguages.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ describe('req', function(){
var app = express();

app.use(function(req, res){
req.acceptsLanguages('en-us').should.be.ok;
req.acceptsLanguages('en').should.be.ok;
req.acceptsLanguages('en-us').should.be.ok()
req.acceptsLanguages('en').should.be.ok()
res.end();
});

Expand All @@ -23,7 +23,7 @@ describe('req', function(){
var app = express();

app.use(function(req, res){
req.acceptsLanguages('es').should.not.be.ok;
req.acceptsLanguages('es').should.not.be.ok()
res.end();
});

Expand All @@ -38,9 +38,9 @@ describe('req', function(){
var app = express();

app.use(function(req, res){
req.acceptsLanguages('en').should.be.ok;
req.acceptsLanguages('es').should.be.ok;
req.acceptsLanguages('jp').should.be.ok;
req.acceptsLanguages('en').should.be.ok()
req.acceptsLanguages('es').should.be.ok()
req.acceptsLanguages('jp').should.be.ok()
res.end();
});

Expand Down
8 changes: 4 additions & 4 deletions test/req.xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('req', function(){
var app = express();

app.use(function(req, res){
req.xhr.should.be.true;
req.xhr.should.be.true()
res.end();
});

Expand All @@ -25,7 +25,7 @@ describe('req', function(){
var app = express();

app.use(function(req, res){
req.xhr.should.be.true;
req.xhr.should.be.true()
res.end();
});

Expand All @@ -42,7 +42,7 @@ describe('req', function(){
var app = express();

app.use(function(req, res){
req.xhr.should.be.false;
req.xhr.should.be.false()
res.end();
});

Expand All @@ -59,7 +59,7 @@ describe('req', function(){
var app = express();

app.use(function(req, res){
req.xhr.should.be.false;
req.xhr.should.be.false()
res.end();
});

Expand Down
14 changes: 7 additions & 7 deletions test/res.sendFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('res', function(){
});

app.use(function (err, req, res, next) {
err.code.should.be.empty;
err.code.should.be.empty()
cb();
});

Expand Down Expand Up @@ -224,7 +224,7 @@ describe('res', function(){
app.use(function (req, res) {
setImmediate(function () {
res.sendFile(path.resolve(fixtures, 'name.txt'), function (err) {
should(err).be.ok;
should(err).be.ok()
err.code.should.equal('ECONNABORTED');
cb();
});
Expand All @@ -243,7 +243,7 @@ describe('res', function(){
app.use(function (req, res) {
onFinished(res, function () {
res.sendFile(path.resolve(fixtures, 'name.txt'), function (err) {
should(err).be.ok;
should(err).be.ok()
err.code.should.equal('ECONNABORTED');
cb();
});
Expand Down Expand Up @@ -294,7 +294,7 @@ describe('res', function(){

app.use(function (req, res) {
res.sendFile(path.resolve(fixtures, 'does-not-exist'), function (err) {
should(err).be.ok;
should(err).be.ok()
err.status.should.equal(404);
res.send('got it');
});
Expand Down Expand Up @@ -348,7 +348,7 @@ describe('res', function(){
app.use(function (req, res) {
setImmediate(function () {
res.sendfile('test/fixtures/name.txt', function (err) {
should(err).be.ok;
should(err).be.ok()
err.code.should.equal('ECONNABORTED');
cb();
});
Expand All @@ -367,7 +367,7 @@ describe('res', function(){
app.use(function (req, res) {
onFinished(res, function () {
res.sendfile('test/fixtures/name.txt', function (err) {
should(err).be.ok;
should(err).be.ok()
err.code.should.equal('ECONNABORTED');
cb();
});
Expand Down Expand Up @@ -600,7 +600,7 @@ describe('res', function(){
});

app.use(function (err, req, res, next) {
err.code.should.be.empty;
err.code.should.be.empty()
cb();
});

Expand Down

0 comments on commit 713d2ae

Please sign in to comment.