Skip to content

Commit 713d2ae

Browse files
Lysander6dougwilson
authored andcommitted
tests: fix incorrect should usage
closes expressjs#3387
1 parent e0aa8bf commit 713d2ae

13 files changed

+51
-51
lines changed

test/Route.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('Route', function(){
2525

2626
route.dispatch(req, {}, function (err) {
2727
if (err) return done(err);
28-
should(req.called).be.ok;
28+
should(req.called).be.ok()
2929
done();
3030
});
3131
})
@@ -84,7 +84,7 @@ describe('Route', function(){
8484

8585
route.dispatch(req, {}, function (err) {
8686
if (err) return done(err);
87-
should(req.called).be.ok;
87+
should(req.called).be.ok()
8888
done();
8989
});
9090
})
@@ -104,7 +104,7 @@ describe('Route', function(){
104104

105105
route.dispatch(req, {}, function (err) {
106106
if (err) return done(err);
107-
should(req.called).be.true;
107+
should(req.called).be.true()
108108
done();
109109
});
110110
})
@@ -156,7 +156,7 @@ describe('Route', function(){
156156
});
157157

158158
route.dispatch(req, {}, function (err) {
159-
should(err).be.ok;
159+
should(err).be.ok()
160160
should(err.message).equal('foobar');
161161
req.order.should.equal('a');
162162
done();
@@ -182,7 +182,7 @@ describe('Route', function(){
182182
});
183183

184184
route.dispatch(req, {}, function (err) {
185-
should(err).be.ok;
185+
should(err).be.ok()
186186
should(err.message).equal('foobar');
187187
req.order.should.equal('a');
188188
done();
@@ -222,7 +222,7 @@ describe('Route', function(){
222222
});
223223

224224
route.dispatch(req, {}, function(err){
225-
should(err).be.ok;
225+
should(err).be.ok()
226226
err.message.should.equal('boom!');
227227
done();
228228
});
@@ -234,7 +234,7 @@ describe('Route', function(){
234234

235235
route.all(function(err, req, res, next){
236236
// this should not execute
237-
true.should.be.false;
237+
true.should.be.false()
238238
});
239239

240240
route.dispatch(req, {}, done);

test/Router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('Router', function(){
4747
var router = new Router();
4848

4949
router.use(function (req, res) {
50-
false.should.be.true;
50+
false.should.be.true()
5151
});
5252

5353
router.handle({ url: '', method: 'GET' }, {}, done);

test/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe('in development', function(){
8686
it('should disable "view cache"', function(){
8787
process.env.NODE_ENV = 'development';
8888
var app = express();
89-
app.enabled('view cache').should.be.false;
89+
app.enabled('view cache').should.be.false()
9090
process.env.NODE_ENV = 'test';
9191
})
9292
})
@@ -95,7 +95,7 @@ describe('in production', function(){
9595
it('should enable "view cache"', function(){
9696
process.env.NODE_ENV = 'production';
9797
var app = express();
98-
app.enabled('view cache').should.be.true;
98+
app.enabled('view cache').should.be.true()
9999
process.env.NODE_ENV = 'test';
100100
})
101101
})

test/app.param.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ describe('app', function(){
5757

5858
app.get('/post/:id', function(req, res){
5959
var id = req.params.id;
60-
id.should.be.a.Number;
60+
id.should.be.a.Number()
6161
res.send('' + id);
6262
});
6363

6464
app.get('/user/:uid', function(req, res){
6565
var id = req.params.id;
66-
id.should.be.a.Number;
66+
id.should.be.a.Number()
6767
res.send('' + id);
6868
});
6969

@@ -91,7 +91,7 @@ describe('app', function(){
9191

9292
app.get('/user/:id', function(req, res){
9393
var id = req.params.id;
94-
id.should.be.a.Number;
94+
id.should.be.a.Number()
9595
res.send('' + id);
9696
});
9797

test/app.render.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe('app', function(){
7272
app.set('view', View);
7373

7474
app.render('something', function(err, str){
75-
err.should.be.ok;
75+
err.should.be.ok()
7676
err.message.should.equal('err!');
7777
done();
7878
})

test/app.routes.error.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ describe('app', function(){
4444
d = true;
4545
next();
4646
}, function(req, res){
47-
a.should.be.false;
48-
b.should.be.true;
49-
c.should.be.true;
50-
d.should.be.false;
47+
a.should.be.false()
48+
b.should.be.true()
49+
c.should.be.true()
50+
d.should.be.false()
5151
res.send(204);
5252
});
5353

test/exports.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ var should = require('should');
55

66
describe('exports', function(){
77
it('should expose Router', function(){
8-
express.Router.should.be.a.Function;
8+
express.Router.should.be.a.Function()
99
})
1010

1111
it('should expose the application prototype', function(){
12-
express.application.set.should.be.a.Function;
12+
express.application.set.should.be.a.Function()
1313
})
1414

1515
it('should expose the request prototype', function(){
16-
express.request.accepts.should.be.a.Function;
16+
express.request.accepts.should.be.a.Function()
1717
})
1818

1919
it('should expose the response prototype', function(){
20-
express.response.send.should.be.a.Function;
20+
express.response.send.should.be.a.Function()
2121
})
2222

2323
it('should permit modifying the .application prototype', function(){

test/req.acceptsEncoding.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ describe('req', function(){
88
var app = express();
99

1010
app.use(function(req, res){
11-
req.acceptsEncoding('gzip').should.be.ok;
12-
req.acceptsEncoding('deflate').should.be.ok;
11+
req.acceptsEncoding('gzip').should.be.ok()
12+
req.acceptsEncoding('deflate').should.be.ok()
1313
res.end();
1414
});
1515

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

2525
app.use(function(req, res){
26-
req.acceptsEncoding('bogus').should.not.be.ok;
26+
req.acceptsEncoding('bogus').should.not.be.ok()
2727
res.end();
2828
});
2929

test/req.acceptsEncodings.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ describe('req', function(){
88
var app = express();
99

1010
app.use(function(req, res){
11-
req.acceptsEncodings('gzip').should.be.ok;
12-
req.acceptsEncodings('deflate').should.be.ok;
11+
req.acceptsEncodings('gzip').should.be.ok()
12+
req.acceptsEncodings('deflate').should.be.ok()
1313
res.end();
1414
});
1515

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

2525
app.use(function(req, res){
26-
req.acceptsEncodings('bogus').should.not.be.ok;
26+
req.acceptsEncodings('bogus').should.not.be.ok()
2727
res.end();
2828
});
2929

test/req.acceptsLanguage.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ describe('req', function(){
88
var app = express();
99

1010
app.use(function(req, res){
11-
req.acceptsLanguage('en-us').should.be.ok;
12-
req.acceptsLanguage('en').should.be.ok;
11+
req.acceptsLanguage('en-us').should.be.ok()
12+
req.acceptsLanguage('en').should.be.ok()
1313
res.end();
1414
});
1515

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

2525
app.use(function(req, res){
26-
req.acceptsLanguage('es').should.not.be.ok;
26+
req.acceptsLanguage('es').should.not.be.ok()
2727
res.end();
2828
});
2929

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

4040
app.use(function(req, res){
41-
req.acceptsLanguage('en').should.be.ok;
42-
req.acceptsLanguage('es').should.be.ok;
43-
req.acceptsLanguage('jp').should.be.ok;
41+
req.acceptsLanguage('en').should.be.ok()
42+
req.acceptsLanguage('es').should.be.ok()
43+
req.acceptsLanguage('jp').should.be.ok()
4444
res.end();
4545
});
4646

test/req.acceptsLanguages.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ describe('req', function(){
88
var app = express();
99

1010
app.use(function(req, res){
11-
req.acceptsLanguages('en-us').should.be.ok;
12-
req.acceptsLanguages('en').should.be.ok;
11+
req.acceptsLanguages('en-us').should.be.ok()
12+
req.acceptsLanguages('en').should.be.ok()
1313
res.end();
1414
});
1515

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

2525
app.use(function(req, res){
26-
req.acceptsLanguages('es').should.not.be.ok;
26+
req.acceptsLanguages('es').should.not.be.ok()
2727
res.end();
2828
});
2929

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

4040
app.use(function(req, res){
41-
req.acceptsLanguages('en').should.be.ok;
42-
req.acceptsLanguages('es').should.be.ok;
43-
req.acceptsLanguages('jp').should.be.ok;
41+
req.acceptsLanguages('en').should.be.ok()
42+
req.acceptsLanguages('es').should.be.ok()
43+
req.acceptsLanguages('jp').should.be.ok()
4444
res.end();
4545
});
4646

test/req.xhr.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('req', function(){
88
var app = express();
99

1010
app.use(function(req, res){
11-
req.xhr.should.be.true;
11+
req.xhr.should.be.true()
1212
res.end();
1313
});
1414

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

2727
app.use(function(req, res){
28-
req.xhr.should.be.true;
28+
req.xhr.should.be.true()
2929
res.end();
3030
});
3131

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

4444
app.use(function(req, res){
45-
req.xhr.should.be.false;
45+
req.xhr.should.be.false()
4646
res.end();
4747
});
4848

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

6161
app.use(function(req, res){
62-
req.xhr.should.be.false;
62+
req.xhr.should.be.false()
6363
res.end();
6464
});
6565

test/res.sendFile.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ describe('res', function(){
108108
});
109109

110110
app.use(function (err, req, res, next) {
111-
err.code.should.be.empty;
111+
err.code.should.be.empty()
112112
cb();
113113
});
114114

@@ -224,7 +224,7 @@ describe('res', function(){
224224
app.use(function (req, res) {
225225
setImmediate(function () {
226226
res.sendFile(path.resolve(fixtures, 'name.txt'), function (err) {
227-
should(err).be.ok;
227+
should(err).be.ok()
228228
err.code.should.equal('ECONNABORTED');
229229
cb();
230230
});
@@ -243,7 +243,7 @@ describe('res', function(){
243243
app.use(function (req, res) {
244244
onFinished(res, function () {
245245
res.sendFile(path.resolve(fixtures, 'name.txt'), function (err) {
246-
should(err).be.ok;
246+
should(err).be.ok()
247247
err.code.should.equal('ECONNABORTED');
248248
cb();
249249
});
@@ -294,7 +294,7 @@ describe('res', function(){
294294

295295
app.use(function (req, res) {
296296
res.sendFile(path.resolve(fixtures, 'does-not-exist'), function (err) {
297-
should(err).be.ok;
297+
should(err).be.ok()
298298
err.status.should.equal(404);
299299
res.send('got it');
300300
});
@@ -348,7 +348,7 @@ describe('res', function(){
348348
app.use(function (req, res) {
349349
setImmediate(function () {
350350
res.sendfile('test/fixtures/name.txt', function (err) {
351-
should(err).be.ok;
351+
should(err).be.ok()
352352
err.code.should.equal('ECONNABORTED');
353353
cb();
354354
});
@@ -367,7 +367,7 @@ describe('res', function(){
367367
app.use(function (req, res) {
368368
onFinished(res, function () {
369369
res.sendfile('test/fixtures/name.txt', function (err) {
370-
should(err).be.ok;
370+
should(err).be.ok()
371371
err.code.should.equal('ECONNABORTED');
372372
cb();
373373
});
@@ -600,7 +600,7 @@ describe('res', function(){
600600
});
601601

602602
app.use(function (err, req, res, next) {
603-
err.code.should.be.empty;
603+
err.code.should.be.empty()
604604
cb();
605605
});
606606

0 commit comments

Comments
 (0)