Skip to content

Commit 178749c

Browse files
committed
Update supertest (+fixes)
1 parent 31d877f commit 178749c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"express": "^4.4.3",
2626
"mocha": "^1.20.1",
2727
"should": "^4.0.4",
28-
"supertest": "0.5.x"
28+
"supertest": "^0.13.0"
2929
},
3030
"licenses": [
3131
{

test/authorise.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('Authorise', function() {
6666

6767
request(app)
6868
.get('/?access_token=thom')
69-
.expect(/nightworld/, 200, done);
69+
.expect(200, /nightworld/, done);
7070
});
7171

7272
it('should require application/x-www-form-urlencoded when access token is ' +
@@ -97,7 +97,7 @@ describe('Authorise', function() {
9797
.post('/')
9898
.set('Content-Type', 'application/x-www-form-urlencoded')
9999
.send({ access_token: 'thom' })
100-
.expect(/nightworld/, 200, done);
100+
.expect(200, /nightworld/, done);
101101
});
102102

103103
it('should detect malformed header', function (done) {
@@ -115,7 +115,7 @@ describe('Authorise', function() {
115115
request(app)
116116
.get('/')
117117
.set('Authorization', 'Bearer thom')
118-
.expect(/nightworld/, 200, done);
118+
.expect(200, /nightworld/, done);
119119
});
120120

121121
it('should allow exactly one method (get: query + auth)', function (done) {
@@ -182,7 +182,7 @@ describe('Authorise', function() {
182182

183183
request(app)
184184
.get('/?access_token=thom')
185-
.expect(/nightworld/, 200, done);
185+
.expect(200, /nightworld/, done);
186186
});
187187

188188
it('should expose the user id when setting userId', function (done) {
@@ -207,7 +207,7 @@ describe('Authorise', function() {
207207

208208
request(app)
209209
.get('/?access_token=thom')
210-
.expect(/nightworld/, 200, done);
210+
.expect(200, /nightworld/, done);
211211
});
212212

213213
it('should expose the user id when setting user object', function (done) {
@@ -234,7 +234,7 @@ describe('Authorise', function() {
234234

235235
request(app)
236236
.get('/?access_token=thom')
237-
.expect(/nightworld/, 200, done);
237+
.expect(200, /nightworld/, done);
238238
});
239239

240240
});

test/grant.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ describe('Grant', function() {
248248
.post('/oauth/token')
249249
.set('Content-Type', 'application/x-www-form-urlencoded')
250250
.send(validBody)
251-
.expect(/thommy/, 200, done);
251+
.expect(200, /thommy/, done);
252252

253253
});
254254

@@ -278,7 +278,7 @@ describe('Grant', function() {
278278
.post('/oauth/token')
279279
.set('Content-Type', 'application/x-www-form-urlencoded')
280280
.send(validBody)
281-
.expect(/"access_token":"thommy"/, 200, done);
281+
.expect(200, /"access_token":"thommy"/, done);
282282

283283
});
284284
});

0 commit comments

Comments
 (0)