@serenity-js/local-server 2.32.7 → 3.0.0-rc.10
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
CHANGED
|
@@ -3,6 +3,201 @@
|
|
|
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.10](https://github.com/serenity-js/serenity-js/compare/v2.33.0...v3.0.0-rc.10) (2022-02-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# [3.0.0-rc.9](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.8...v3.0.0-rc.9) (2022-02-01)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.0.0-rc.8](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.7...v3.0.0-rc.8) (2022-01-28)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# [3.0.0-rc.7](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.6...v3.0.0-rc.7) (2022-01-28)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* **core:** replaced `Adapter` with `QuestionAdapter` and introduced `Optional` ([8d84ad3](https://github.com/serenity-js/serenity-js/commit/8d84ad3863e3c726533d0f21934fb1e2fa8b3022)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# [3.0.0-rc.6](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v3.0.0-rc.6) (2022-01-10)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# [3.0.0-rc.5](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.4...v3.0.0-rc.5) (2022-01-07)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# [3.0.0-rc.4](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.3...v3.0.0-rc.4) (2021-12-30)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
# [3.0.0-rc.3](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.2...v3.0.0-rc.3) (2021-12-29)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# [3.0.0-rc.2](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.1...v3.0.0-rc.2) (2021-12-09)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# [3.0.0-rc.1](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.0...v3.0.0-rc.1) (2021-12-09)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# [3.0.0-rc.0](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v3.0.0-rc.0) (2021-12-08)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Bug Fixes
|
|
55
|
+
|
|
56
|
+
* **core:** 3.0 RC ([469d54e](https://github.com/serenity-js/serenity-js/commit/469d54e4f81ef430566b93852e3174826f8ef672)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### BREAKING CHANGES
|
|
60
|
+
|
|
61
|
+
* **core:** Introduced @serenity-js/web - a shared library for Serenity/JS Web integration
|
|
62
|
+
modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# [3.0.0-rc.9](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.8...v3.0.0-rc.9) (2022-02-01)
|
|
69
|
+
|
|
70
|
+
**Note:** Version bump only for package @serenity-js/local-server
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
# [3.0.0-rc.8](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.7...v3.0.0-rc.8) (2022-01-28)
|
|
77
|
+
|
|
78
|
+
**Note:** Version bump only for package @serenity-js/local-server
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# [3.0.0-rc.7](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.6...v3.0.0-rc.7) (2022-01-28)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
### Features
|
|
88
|
+
|
|
89
|
+
* **core:** replaced `Adapter` with `QuestionAdapter` and introduced `Optional` ([8d84ad3](https://github.com/serenity-js/serenity-js/commit/8d84ad3863e3c726533d0f21934fb1e2fa8b3022)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
# [3.0.0-rc.6](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v3.0.0-rc.6) (2022-01-10)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
# [3.0.0-rc.5](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.4...v3.0.0-rc.5) (2022-01-07)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
# [3.0.0-rc.4](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.3...v3.0.0-rc.4) (2021-12-30)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
# [3.0.0-rc.3](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.2...v3.0.0-rc.3) (2021-12-29)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
# [3.0.0-rc.2](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.1...v3.0.0-rc.2) (2021-12-09)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
# [3.0.0-rc.1](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.0...v3.0.0-rc.1) (2021-12-09)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
# [3.0.0-rc.0](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v3.0.0-rc.0) (2021-12-08)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
### Bug Fixes
|
|
123
|
+
|
|
124
|
+
* **core:** 3.0 RC ([469d54e](https://github.com/serenity-js/serenity-js/commit/469d54e4f81ef430566b93852e3174826f8ef672)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### BREAKING CHANGES
|
|
128
|
+
|
|
129
|
+
* **core:** Introduced @serenity-js/web - a shared library for Serenity/JS Web integration
|
|
130
|
+
modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
# [3.0.0-rc.5](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.4...v3.0.0-rc.5) (2022-01-07)
|
|
137
|
+
|
|
138
|
+
**Note:** Version bump only for package @serenity-js/local-server
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# [3.0.0-rc.4](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.3...v3.0.0-rc.4) (2021-12-30)
|
|
145
|
+
|
|
146
|
+
**Note:** Version bump only for package @serenity-js/local-server
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
# [3.0.0-rc.3](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.2...v3.0.0-rc.3) (2021-12-29)
|
|
153
|
+
|
|
154
|
+
**Note:** Version bump only for package @serenity-js/local-server
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
# [3.0.0-rc.2](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.1...v3.0.0-rc.2) (2021-12-09)
|
|
161
|
+
|
|
162
|
+
**Note:** Version bump only for package @serenity-js/local-server
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
# [3.0.0-rc.1](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.0...v3.0.0-rc.1) (2021-12-09)
|
|
169
|
+
|
|
170
|
+
**Note:** Version bump only for package @serenity-js/local-server
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
# [3.0.0-rc.0](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v3.0.0-rc.0) (2021-12-08)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
### Bug Fixes
|
|
180
|
+
|
|
181
|
+
* **core:** 3.0 RC ([469d54e](https://github.com/serenity-js/serenity-js/commit/469d54e4f81ef430566b93852e3174826f8ef672)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
### BREAKING CHANGES
|
|
185
|
+
|
|
186
|
+
* **core:** Introduced @serenity-js/web - a shared library for Serenity/JS Web integration
|
|
187
|
+
modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
# [2.33.0](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v2.33.0) (2022-02-03)
|
|
194
|
+
|
|
195
|
+
**Note:** Version bump only for package @serenity-js/local-server
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
6
201
|
## [2.32.7](https://github.com/serenity-js/serenity-js/compare/v2.32.6...v2.32.7) (2022-01-10)
|
|
7
202
|
|
|
8
203
|
**Note:** Version bump only for package @serenity-js/local-server
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QuestionAdapter } from '@serenity-js/core';
|
|
2
2
|
export declare class LocalServer {
|
|
3
3
|
/**
|
|
4
4
|
* @desc
|
|
@@ -12,7 +12,7 @@ export declare class LocalServer {
|
|
|
12
12
|
*
|
|
13
13
|
* @returns {@serenity-js/core/lib/screenplay~Question<string>}
|
|
14
14
|
*/
|
|
15
|
-
static url():
|
|
15
|
+
static url(): QuestionAdapter<string>;
|
|
16
16
|
/**
|
|
17
17
|
* @desc
|
|
18
18
|
* Retrieves the port number of the local server started
|
|
@@ -25,5 +25,5 @@ export declare class LocalServer {
|
|
|
25
25
|
*
|
|
26
26
|
* @returns {@serenity-js/core/lib/screenplay~Question<number>}
|
|
27
27
|
*/
|
|
28
|
-
static port():
|
|
28
|
+
static port(): QuestionAdapter<number>;
|
|
29
29
|
}
|
|
@@ -50,9 +50,9 @@ class LocalServer {
|
|
|
50
50
|
* @returns {@serenity-js/core/lib/screenplay~Question<number>}
|
|
51
51
|
*/
|
|
52
52
|
static port() {
|
|
53
|
-
return core_1.Question.about(`local server port number`, actor => {
|
|
54
|
-
const url = LocalServer.url()
|
|
55
|
-
return Number.parseInt(
|
|
53
|
+
return core_1.Question.about(`local server port number`, async (actor) => {
|
|
54
|
+
const url = await actor.answer(LocalServer.url());
|
|
55
|
+
return Number.parseInt(new url_1.URL(url).port, 10);
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalServer.js","sourceRoot":"","sources":["../../../src/screenplay/questions/LocalServer.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"LocalServer.js","sourceRoot":"","sources":["../../../src/screenplay/questions/LocalServer.ts"],"names":[],"mappings":";;;AAAA,4CAA0E;AAE1E,6BAA0B;AAE1B,4CAAkD;AAElD,MAAa,WAAW;IAEpB;;;;;;;;;;;OAWG;IACH,MAAM,C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pC,CAAC,CAAE,gBAAgB,CAAC,OAAO;WAC3B,CAAC,CAAE,gBAAgB,CAAC,MAAM;WAC1B,CAAC,CAAE,gBAAgB,CAAC,IAAI,CAAC;AACpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/local-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-rc.10",
|
|
4
4
|
"description": "Enables Serenity/JS Actors to manage local Node.js test servers, such as Express, Koa or Restify",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Molak",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
],
|
|
34
34
|
"scripts": {
|
|
35
35
|
"clean": "rimraf .nyc_output lib target",
|
|
36
|
-
"lint": "eslint --ext ts --config ../../.eslintrc.
|
|
36
|
+
"lint": "eslint --ext ts --config ../../.eslintrc.yml .",
|
|
37
37
|
"lint:fix": "npm run lint -- --fix",
|
|
38
|
-
"test": "nyc --report-dir ../../target/coverage/
|
|
38
|
+
"test": "nyc --report-dir ../../target/coverage/local-server mocha --config ../../.mocharc.yml 'spec/**/*.spec.*'",
|
|
39
39
|
"compile": "tsc --project tsconfig.json",
|
|
40
40
|
"site": "esdoc -c .esdoc.js"
|
|
41
41
|
},
|
|
@@ -47,20 +47,20 @@
|
|
|
47
47
|
"url": "https://github.com/serenity-js/serenity-js/issues"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
|
-
"node": "^
|
|
50
|
+
"node": "^14 || ^16",
|
|
51
51
|
"npm": "^6 || ^7 || ^8"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@serenity-js/core": "
|
|
54
|
+
"@serenity-js/core": "3.0.0-rc.10",
|
|
55
55
|
"http-shutdown": "^1.2.2",
|
|
56
56
|
"portfinder": "^1.0.28"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@documentation/esdoc-template": "
|
|
59
|
+
"@documentation/esdoc-template": "3.0.0",
|
|
60
60
|
"@hapi/hapi": "^20.2.1",
|
|
61
|
-
"@integration/testing-tools": "
|
|
62
|
-
"@serenity-js/assertions": "
|
|
63
|
-
"@serenity-js/rest": "
|
|
61
|
+
"@integration/testing-tools": "3.0.0",
|
|
62
|
+
"@serenity-js/assertions": "3.0.0-rc.10",
|
|
63
|
+
"@serenity-js/rest": "3.0.0-rc.10",
|
|
64
64
|
"@types/chai": "^4.3.0",
|
|
65
65
|
"@types/express": "^4.17.13",
|
|
66
66
|
"@types/hapi": "^18.0.7",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"cache": true,
|
|
98
98
|
"all": true
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "7e8570d412348980c22a6e189ebc4c4f0157919d"
|
|
101
101
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LogicError, Question } from '@serenity-js/core';
|
|
1
|
+
import { LogicError, Question, QuestionAdapter } from '@serenity-js/core';
|
|
2
2
|
import { AddressInfo } from 'net';
|
|
3
|
-
import {
|
|
3
|
+
import { URL } from 'url';
|
|
4
4
|
|
|
5
5
|
import { ManageALocalServer } from '../abilities';
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ export class LocalServer {
|
|
|
18
18
|
*
|
|
19
19
|
* @returns {@serenity-js/core/lib/screenplay~Question<string>}
|
|
20
20
|
*/
|
|
21
|
-
static url():
|
|
21
|
+
static url(): QuestionAdapter<string> {
|
|
22
22
|
return Question.about<string>('the URL of the local server', actor => {
|
|
23
23
|
return ManageALocalServer.as(actor).mapInstance((server, protocol) => {
|
|
24
24
|
const info = server.address();
|
|
@@ -54,11 +54,11 @@ export class LocalServer {
|
|
|
54
54
|
*
|
|
55
55
|
* @returns {@serenity-js/core/lib/screenplay~Question<number>}
|
|
56
56
|
*/
|
|
57
|
-
static port():
|
|
58
|
-
return Question.about(`local server port number`, actor => {
|
|
59
|
-
const url = LocalServer.url()
|
|
57
|
+
static port(): QuestionAdapter<number> {
|
|
58
|
+
return Question.about(`local server port number`, async actor => {
|
|
59
|
+
const url = await actor.answer(LocalServer.url());
|
|
60
60
|
|
|
61
|
-
return Number.parseInt(
|
|
61
|
+
return Number.parseInt(new URL(url).port, 10);
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
}
|