Skip to content

Commit 199506d

Browse files
committed
Prepare 3.0.0 release. Small readme updates, update dev libs.
1 parent 1d82e5b commit 199506d

File tree

3 files changed

+29
-23
lines changed

3 files changed

+29
-23
lines changed

History.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
3.0.0 / 2017-01-29
2+
===================
3+
4+
* PR-373 - Allow TestAgent pass a cert and key to request (thanks @toefraz)
5+
* PR-392 - Update readme with promise example (thanks @ajouve)
6+
* PR-400 - Update to superagent 3 (thanks @alphashuro)
7+
18
2.0.1 / 2016-10-19
29
===================
310

Readme.md

+16-17
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ npm install supertest --save-dev
2626
test framework at all:
2727

2828
```js
29-
var request = require('supertest');
30-
var express = require('express');
29+
const request = require('supertest');
30+
const express = require('express');
3131

32-
var app = express();
32+
const app = express();
3333

3434
app.get('/user', function(req, res) {
3535
res.status(200).json({ name: 'tobi' });
@@ -147,39 +147,38 @@ request.get('/').expect('heya', function(err){
147147
Here's an example with mocha that shows how to persist a request and its cookies:
148148

149149
```js
150-
var request = require('supertest');
151-
var should = require('should');
152-
var express = require('express');
153-
var cookieParser = require('cookie-parser');
150+
const request = require('supertest');
151+
const should = require('should');
152+
const express = require('express');
153+
const cookieParser = require('cookie-parser');
154154

155-
156-
describe('request.agent(app)', function(){
157-
var app = express();
155+
describe('request.agent(app)', function() {
156+
const app = express();
158157
app.use(cookieParser());
159158

160-
app.get('/', function(req, res){
159+
app.get('/', function(req, res) {
161160
res.cookie('cookie', 'hey');
162161
res.send();
163162
});
164163

165-
app.get('/return', function(req, res){
164+
app.get('/return', function(req, res) {
166165
if (req.cookies.cookie) res.send(req.cookies.cookie);
167166
else res.send(':(')
168167
});
169168

170-
var agent = request.agent(app);
169+
const agent = request.agent(app);
171170

172-
it('should save cookies', function(done){
171+
it('should save cookies', function(done) {
173172
agent
174173
.get('/')
175174
.expect('set-cookie', 'cookie=hey; Path=/', done);
176-
})
175+
});
177176

178-
it('should send cookies', function(done){
177+
it('should send cookies', function(done) {
179178
agent
180179
.get('/return')
181180
.expect('hey', done);
182-
})
181+
});
183182
})
184183
```
185184
There is another example that is introduced by the file [agency.js](https://github.com/visionmedia/superagent/blob/master/test/node/agency.js)

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "supertest",
3-
"version": "2.0.1",
3+
"version": "3.0.0",
44
"description": "SuperAgent driven library for testing HTTP servers",
55
"main": "index.js",
66
"scripts": {
@@ -9,19 +9,19 @@
99
},
1010
"dependencies": {
1111
"superagent": "^3.0.0",
12-
"methods": "1.x"
12+
"methods": "~1.1.2"
1313
},
1414
"devDependencies": {
15-
"body-parser": "~1.15.0",
15+
"body-parser": "~1.16.0",
1616
"cookie-parser": "~1.4.1",
17-
"eslint": "^3.8.1",
17+
"eslint": "^3.14.1",
1818
"eslint-config-airbnb": "^12.0.0",
1919
"eslint-plugin-import": "1.16.0",
2020
"eslint-plugin-jsx-a11y": "2.2.3",
2121
"eslint-plugin-react": "6.4.1",
2222
"express": "~4.14.0",
23-
"mocha": "~3.1.2",
24-
"should": "~11.1.1"
23+
"mocha": "~3.2.0",
24+
"should": "~11.2.0"
2525
},
2626
"engines": {
2727
"node": ">=4.0.0"

0 commit comments

Comments
 (0)