Skip to content

Commit

Permalink
Merge pull request #235 from visionmedia/234-expressv4
Browse files Browse the repository at this point in the history
#234 Update Express to version 4 and other dev deps.
  • Loading branch information
mikelax committed Jul 23, 2015
2 parents ab7162b + abd8de6 commit add067c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
"methods": "1.x"
},
"devDependencies": {
"express": "3.20.2",
"mocha": "2.2.4",
"should": "6.0.1",
"body-parser": "~1.12.3"
"express": "~4.12.4",
"mocha": "~2.2.5",
"should": "~7.0.2",
"body-parser": "~1.13.2",
"cookie-parser": "~1.3.5"
},
"engines": {
"node": ">=0.8.0"
Expand Down
25 changes: 13 additions & 12 deletions test/supertest.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ var request = require('..')
, path = require('path')
, should = require('should')
, express = require('express');
var bodyParser = require('body-parser');
var bodyParser = require('body-parser')
, cookieParser = require('cookie-parser');

describe('request(url)', function(){
it('should be supported', function(done){
Expand Down Expand Up @@ -323,7 +324,7 @@ describe('request(app)', function(){
app.set('json spaces', 0);

app.get('/', function(req, res){
res.send(500, { message: 'something went wrong' });
res.status(500).send({ message: 'something went wrong' });
});

request(app)
Expand Down Expand Up @@ -661,7 +662,7 @@ describe('request(app)', function(){
describe('request.agent(app)', function(){
var app = express();

app.use(express.cookieParser());
app.use(cookieParser());

app.get('/', function(req, res){
res.cookie('cookie', 'hey');
Expand Down Expand Up @@ -692,7 +693,7 @@ describe(".<http verb> works as expected", function(){
it(".delete should work", function (done){
var app = express();
app.delete('/', function(req, res){
res.send(200);
res.sendStatus(200);
});

request(app)
Expand All @@ -702,7 +703,7 @@ describe(".<http verb> works as expected", function(){
it(".del should work", function (done){
var app = express();
app.delete('/', function(req, res){
res.send(200);
res.sendStatus(200);
});

request(app)
Expand All @@ -712,7 +713,7 @@ describe(".<http verb> works as expected", function(){
it(".get should work", function (done){
var app = express();
app.get('/', function(req, res){
res.send(200);
res.sendStatus(200);
});

request(app)
Expand All @@ -722,7 +723,7 @@ describe(".<http verb> works as expected", function(){
it(".post should work", function (done){
var app = express();
app.post('/', function(req, res){
res.send(200);
res.sendStatus(200);
});

request(app)
Expand All @@ -732,7 +733,7 @@ describe(".<http verb> works as expected", function(){
it(".put should work", function (done){
var app = express();
app.put('/', function(req, res){
res.send(200);
res.sendStatus(200);
});

request(app)
Expand All @@ -746,7 +747,7 @@ describe("request.get(url).query(vals) works as expected", function(){
it("normal single query string value works", function(done) {
var app = express();
app.get('/', function(req, res){
res.send(200, req.query.val);
res.status(200).send(req.query.val);
});

request(app)
Expand All @@ -761,7 +762,7 @@ describe("request.get(url).query(vals) works as expected", function(){
it("array query string value works", function(done) {
var app = express();
app.get('/', function(req, res){
res.send(200, Array.isArray(req.query.val));
res.status(200).send(Array.isArray(req.query.val));
});

request(app)
Expand All @@ -777,7 +778,7 @@ describe("request.get(url).query(vals) works as expected", function(){
it("array query string value work even with single value", function(done) {
var app = express();
app.get('/', function(req, res){
res.send(200, Array.isArray(req.query.val));
res.status(200).send(Array.isArray(req.query.val));
});

request(app)
Expand All @@ -793,7 +794,7 @@ describe("request.get(url).query(vals) works as expected", function(){
it("object query string value works", function(done) {
var app = express();
app.get('/', function(req, res){
res.send(200, req.query.val.test);
res.status(200).send(req.query.val.test);
});

request(app)
Expand Down

0 comments on commit add067c

Please sign in to comment.