@serenity-js/rest 3.0.0-rc.43 → 3.0.0-rc.45
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/CHANGELOG.md +26 -0
- package/lib/screenplay/interactions/Send.d.ts +1 -1
- package/lib/screenplay/interactions/Send.js +1 -1
- package/lib/screenplay/interactions/Send.js.map +1 -1
- package/lib/screenplay/questions/LastResponse.d.ts +2 -1
- package/lib/screenplay/questions/LastResponse.d.ts.map +1 -1
- package/lib/screenplay/questions/LastResponse.js.map +1 -1
- package/package.json +8 -7
- package/src/screenplay/interactions/Send.ts +3 -3
- package/src/screenplay/questions/LastResponse.ts +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,32 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.0.0-rc.45](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.44...v3.0.0-rc.45) (2023-03-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @serenity-js/rest
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.0.0-rc.44](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.43...v3.0.0-rc.44) (2023-03-19)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **core:** moved time-related code to a common package ([f29fedc](https://github.com/serenity-js/serenity-js/commit/f29fedc0e67d0db942b247aed53a243868a5f6dd)), closes [#1522](https://github.com/serenity-js/serenity-js/issues/1522)
|
|
20
|
+
* **core:** support for NPM 9 ([0493474](https://github.com/serenity-js/serenity-js/commit/0493474a1e28b86b1b60f69ec0d591c1a3265425))
|
|
21
|
+
* **rest:** support for Axios 1.3.4 ([e926bbd](https://github.com/serenity-js/serenity-js/commit/e926bbde5232150f35e137601e321175d21d52d2))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* **core:** introduced a new ability ScheduleWork to enable [#1083](https://github.com/serenity-js/serenity-js/issues/1083) and [#1522](https://github.com/serenity-js/serenity-js/issues/1522) ([b275d18](https://github.com/serenity-js/serenity-js/commit/b275d18434cdedf069c5f1da3b9b359fc7da60fe))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
6
32
|
# [3.0.0-rc.43](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.42...v3.0.0-rc.43) (2023-03-10)
|
|
7
33
|
|
|
8
34
|
**Note:** Version bump only for package @serenity-js/rest
|
|
@@ -9,7 +9,7 @@ import { AxiosRequestConfig } from 'axios';
|
|
|
9
9
|
*
|
|
10
10
|
* ```ts
|
|
11
11
|
* import { actorCalled } from '@serenity-js/core'
|
|
12
|
-
* import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest
|
|
12
|
+
* import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
|
|
13
13
|
* import { Ensure, equals } from '@serenity-js/assertions'
|
|
14
14
|
*
|
|
15
15
|
* await actorCalled('Apisit')
|
|
@@ -14,7 +14,7 @@ const abilities_1 = require("../abilities");
|
|
|
14
14
|
*
|
|
15
15
|
* ```ts
|
|
16
16
|
* import { actorCalled } from '@serenity-js/core'
|
|
17
|
-
* import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest
|
|
17
|
+
* import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
|
|
18
18
|
* import { Ensure, equals } from '@serenity-js/assertions'
|
|
19
19
|
*
|
|
20
20
|
* await actorCalled('Apisit')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Send.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/Send.ts"],"names":[],"mappings":";;;AAAA,4CAAgH;AAChH,uDAAsG;AACt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8C,oBAAY,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,MAAM,CAAC,IAAI,CAA8C,CAAC;QAEnK,MAAM,oBAAoB,GAAmD,QAAQ,CAAC,OAAO,CAAC;QAC9F,MAAM,eAAe,GAAG,oBAAY,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,MAAM,CAAC,KAAK,CAA4B,CAAC;QAEzG,MAAM,kBAAkB,GAAuB;YAC3C,OAAO,EAAE;gBACL,MAAM,EAAM,OAAO,CAAC,MAAM;gBAC1B,GAAG,EAAS,SAAS;gBACrB,OAAO,EAAK,cAAc;gBAC1B,IAAI,EAAQ,OAAO,CAAC,IAAI;aAC3B;YACD,QAAQ,EAAE;gBACN,MAAM,EAAM,QAAQ,CAAC,MAAM;gBAC3B,OAAO,EAAK,eAAkF;gBAC9F,IAAI,EAAQ,QAAQ,CAAC,IAAI;aAC5B;SACJ,CAAC;QAEF,OAAO,2BAAmB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAC5D,CAAC;IAEO,qBAAqB,CAAC,MAAc,EAAE,GAAW;QACrD,OAAO,IAAI,YAAI,CAAC,GAAI,MAAM,CAAC,WAAW,EAAG,IAAK,GAAI,EAAE,CAAC,CAAC;IAC1D,CAAC;CACJ;AArED,oBAqEC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { QuestionAdapter } from '@serenity-js/core';
|
|
2
|
+
import { RawAxiosResponseHeaders } from 'axios';
|
|
2
3
|
/**
|
|
3
4
|
* Provides access to the properties of the last {@apilink AxiosResponse} object,
|
|
4
5
|
* cached on the {@apilink Ability|ability} to {@apilink CallAnApi}.
|
|
@@ -183,6 +184,6 @@ export declare class LastResponse {
|
|
|
183
184
|
* )
|
|
184
185
|
* ```
|
|
185
186
|
*/
|
|
186
|
-
static headers(): QuestionAdapter<
|
|
187
|
+
static headers(): QuestionAdapter<RawAxiosResponseHeaders>;
|
|
187
188
|
}
|
|
188
189
|
//# sourceMappingURL=LastResponse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LastResponse.d.ts","sourceRoot":"","sources":["../../../src/screenplay/questions/LastResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"LastResponse.d.ts","sourceRoot":"","sources":["../../../src/screenplay/questions/LastResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAC;AAIhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,qBAAa,YAAY;IAErB;;;;;OAKG;IACH,MAAM,CAAC,MAAM,IAAI,eAAe,CAAC,MAAM,CAAC;IAMxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyEG;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,KAAK,eAAe,CAAC,CAAC,CAAC;IAM1C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;IAMpD;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,OAAO,IAAI,eAAe,CAAC,uBAAuB,CAAC;CAK7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LastResponse.js","sourceRoot":"","sources":["../../../src/screenplay/questions/LastResponse.ts"],"names":[],"mappings":";;;AAAA,4CAA8D;
|
|
1
|
+
{"version":3,"file":"LastResponse.js","sourceRoot":"","sources":["../../../src/screenplay/questions/LastResponse.ts"],"names":[],"mappings":";;;AAAA,4CAA8D;AAG9D,4CAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAkC,CAAC,CAAC;QACxG,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AA/ID,oCA+IC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/rest",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.45",
|
|
4
4
|
"description": "Test REST APIs with Serenity/JS",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Molak",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"testing"
|
|
29
29
|
],
|
|
30
30
|
"scripts": {
|
|
31
|
-
"clean": "rimraf
|
|
31
|
+
"clean": "rimraf target",
|
|
32
32
|
"test": "nyc mocha --config ../../.mocharc.yml 'spec/**/*.spec.*'",
|
|
33
33
|
"compile": "rimraf lib && tsc --project tsconfig.build.json"
|
|
34
34
|
},
|
|
@@ -42,22 +42,23 @@
|
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
44
44
|
"node": "^14 || ^16 || ^18",
|
|
45
|
-
"npm": "^6 || ^7 || ^8"
|
|
45
|
+
"npm": "^6 || ^7 || ^8 || ^9"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@serenity-js/core": "3.0.0-rc.
|
|
49
|
-
"axios": "^1.
|
|
48
|
+
"@serenity-js/core": "3.0.0-rc.45",
|
|
49
|
+
"axios": "^1.3.4"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@integration/testing-tools": "3.0.0",
|
|
53
|
-
"@serenity-js/assertions": "3.0.0-rc.
|
|
53
|
+
"@serenity-js/assertions": "3.0.0-rc.45",
|
|
54
54
|
"@types/chai": "^4.3.4",
|
|
55
55
|
"@types/mocha": "^10.0.1",
|
|
56
56
|
"axios-mock-adapter": "^1.21.2",
|
|
57
57
|
"mocha": "^10.2.0",
|
|
58
|
+
"mocha-multi": "^1.1.7",
|
|
58
59
|
"nyc": "15.1.0",
|
|
59
60
|
"ts-node": "^10.9.1",
|
|
60
61
|
"typescript": "^4.9.5"
|
|
61
62
|
},
|
|
62
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "4c5c6cdb30f726b51d1567862074bb6fa9b5aa66"
|
|
63
64
|
}
|
|
@@ -13,7 +13,7 @@ import { CallAnApi } from '../abilities';
|
|
|
13
13
|
*
|
|
14
14
|
* ```ts
|
|
15
15
|
* import { actorCalled } from '@serenity-js/core'
|
|
16
|
-
* import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest
|
|
16
|
+
* import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
|
|
17
17
|
* import { Ensure, equals } from '@serenity-js/assertions'
|
|
18
18
|
*
|
|
19
19
|
* await actorCalled('Apisit')
|
|
@@ -73,7 +73,7 @@ export class Send extends Interaction {
|
|
|
73
73
|
const requestHeaders: Record<string, string | number | boolean> = AxiosHeaders.from(axiosRequestHeaders).toJSON(true) as Record<string, string | number | boolean>;
|
|
74
74
|
|
|
75
75
|
const axiosResponseHeaders: RawAxiosResponseHeaders | AxiosResponseHeaders = response.headers;
|
|
76
|
-
const responseHeaders
|
|
76
|
+
const responseHeaders = AxiosHeaders.from(axiosResponseHeaders).toJSON(false) as RawAxiosResponseHeaders;
|
|
77
77
|
|
|
78
78
|
const requestAndResponse: RequestAndResponse = {
|
|
79
79
|
request: {
|
|
@@ -84,7 +84,7 @@ export class Send extends Interaction {
|
|
|
84
84
|
},
|
|
85
85
|
response: {
|
|
86
86
|
status: response.status,
|
|
87
|
-
headers: responseHeaders,
|
|
87
|
+
headers: responseHeaders as unknown as Record<string, string> & { 'set-cookie'?: string[] },
|
|
88
88
|
data: response.data,
|
|
89
89
|
},
|
|
90
90
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Question, QuestionAdapter } from '@serenity-js/core';
|
|
2
|
+
import { RawAxiosResponseHeaders } from 'axios';
|
|
2
3
|
|
|
3
4
|
import { CallAnApi } from '../abilities';
|
|
4
5
|
|
|
@@ -202,9 +203,9 @@ export class LastResponse {
|
|
|
202
203
|
* )
|
|
203
204
|
* ```
|
|
204
205
|
*/
|
|
205
|
-
static headers(): QuestionAdapter<
|
|
206
|
-
return Question.about<
|
|
207
|
-
return CallAnApi.as(actor).mapLastResponse(response => response.headers);
|
|
206
|
+
static headers(): QuestionAdapter<RawAxiosResponseHeaders> {
|
|
207
|
+
return Question.about<RawAxiosResponseHeaders>(`the headers or the last response`, async actor => {
|
|
208
|
+
return CallAnApi.as(actor).mapLastResponse(response => response.headers as RawAxiosResponseHeaders);
|
|
208
209
|
});
|
|
209
210
|
}
|
|
210
211
|
}
|