k6-cucumber-steps 1.0.39 → 1.0.40

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.
@@ -21,9 +21,9 @@ module.exports = function generateHeaders(authType, env, aliases = {}) {
21
21
  ).toString("base64");
22
22
  headers["Authorization"] = `Basic ${base64}`;
23
23
  } else if (authType === "none") {
24
- // Do nothing extra
24
+ // No auth, just default content-type
25
25
  } else if (aliases[authType]) {
26
- // Dynamic alias token support
26
+ // Custom alias support
27
27
  headers["Authorization"] = `Bearer ${getValue(authType)}`;
28
28
  } else {
29
29
  throw new Error(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "k6-cucumber-steps",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -198,8 +198,13 @@ When(
198
198
  * When I set the authentication type to "none"
199
199
  */
200
200
  When("I set the authentication type to {string}", function (authType) {
201
- this.config.headers = generateHeaders(authType, process.env);
201
+ this.config.headers = generateHeaders(
202
+ authType,
203
+ process.env,
204
+ this.aliases || {}
205
+ );
202
206
  });
207
+
203
208
  /**
204
209
  * Then I store the value at "data.token" as alias "token"
205
210
  */