k6-cucumber-steps 1.1.12 → 1.1.13
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.
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
module.exports = function buildK6Script(config) {
|
|
2
|
-
const { method, endpoints, endpoint, body, headers, options } = config;
|
|
2
|
+
const { method, endpoints, endpoint, body, headers, options, baseUrl } = config;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
)
|
|
8
|
-
|
|
4
|
+
// Prefer baseUrl from config (set by step/world), then env
|
|
5
|
+
const BASE_URL =
|
|
6
|
+
baseUrl ||
|
|
7
|
+
(config.worldParameters && config.worldParameters.baseUrl) ||
|
|
8
|
+
process.env.API_BASE_URL ||
|
|
9
|
+
process.env.BASE_URL;
|
|
9
10
|
|
|
10
|
-
const BASE_URL = process.env.API_BASE_URL || process.env.BASE_URL;
|
|
11
11
|
if (!BASE_URL) {
|
|
12
12
|
throw new Error(
|
|
13
|
-
"
|
|
13
|
+
"No base URL found: please provide baseUrl inline (step/world/feature) or set API_BASE_URL/BASE_URL in environment variables."
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
16
|
|