@eggjs/supertest 8.3.0-beta.9 → 9.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -8
- package/package.json +4 -6
package/README.md
CHANGED
|
@@ -99,11 +99,7 @@ Here's an example with mocha, note how you can pass `done` straight to any of th
|
|
|
99
99
|
```js
|
|
100
100
|
describe('GET /user', function () {
|
|
101
101
|
it('responds with json', function (done) {
|
|
102
|
-
request(app)
|
|
103
|
-
.get('/user')
|
|
104
|
-
.set('Accept', 'application/json')
|
|
105
|
-
.expect('Content-Type', /json/)
|
|
106
|
-
.expect(200, done);
|
|
102
|
+
request(app).get('/user').set('Accept', 'application/json').expect('Content-Type', /json/).expect(200, done);
|
|
107
103
|
});
|
|
108
104
|
});
|
|
109
105
|
```
|
|
@@ -170,9 +166,7 @@ Or async/await syntax:
|
|
|
170
166
|
```js
|
|
171
167
|
describe('GET /users', function () {
|
|
172
168
|
it('responds with json', async function () {
|
|
173
|
-
const response = await request(app)
|
|
174
|
-
.get('/users')
|
|
175
|
-
.set('Accept', 'application/json');
|
|
169
|
+
const response = await request(app).get('/users').set('Accept', 'application/json');
|
|
176
170
|
expect(response.headers['Content-Type']).toMatch(/json/);
|
|
177
171
|
expect(response.status).toEqual(200);
|
|
178
172
|
expect(response.body.email).toEqual('foo@bar.com');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/supertest",
|
|
3
3
|
"description": "SuperAgent driven library for testing HTTP servers",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "9.0.0-beta.12",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/eggjs/egg/tree/next/packages/supertest",
|
|
36
36
|
"engines": {
|
|
37
|
-
"node": ">=
|
|
37
|
+
"node": ">=22.18.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@types/superagent": "^8.1.9",
|
|
@@ -44,13 +44,11 @@
|
|
|
44
44
|
"@types/body-parser": "^1.19.5",
|
|
45
45
|
"@types/cookie-parser": "^1.4.8",
|
|
46
46
|
"@types/express": "^5.0.0",
|
|
47
|
-
"@types/node": "24.5.2",
|
|
48
47
|
"body-parser": "^2.0.0",
|
|
49
48
|
"cookie-parser": "^1.4.6",
|
|
50
49
|
"express": "^4.21.2",
|
|
51
|
-
"tsdown": "0.15.
|
|
52
|
-
"typescript": "5.9.2"
|
|
53
|
-
"@eggjs/bin": "7.3.1-beta.7"
|
|
50
|
+
"tsdown": "^0.15.4",
|
|
51
|
+
"typescript": "5.9.2"
|
|
54
52
|
},
|
|
55
53
|
"scripts": {
|
|
56
54
|
"build": "tsdown",
|