From 5c8b6f5ab5693e42a5b088962a964a9a83d7de41 Mon Sep 17 00:00:00 2001 From: Robert Stoll Date: Thu, 16 Jan 2025 14:25:13 +0100 Subject: [PATCH] also pass environment to beforeItem --- README.md | 3 ++- lib/runner/extensions/item.command.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4166e8ce4..74d334ae2 100644 --- a/README.md +++ b/README.md @@ -264,9 +264,10 @@ runner.run(collection, { /* options */ }, function(err, run) { }, // Called before running a new Item (check the postman collection v2 format for what Item means) - beforeItem: function (err, cursor, item) { + beforeItem: function (err, cursor, item, environment) { // err, cursor: Same as arguments for "start" // item: sdk.Item + // environment: }, // Called after completion of an Item diff --git a/lib/runner/extensions/item.command.js b/lib/runner/extensions/item.command.js index ebfa3cc70..0063fdfbc 100644 --- a/lib/runner/extensions/item.command.js +++ b/lib/runner/extensions/item.command.js @@ -132,7 +132,7 @@ module.exports = { coords.ref = uuid.v4(); // here we code to queue prerequest script, then make a request and then execute test script - this.triggers.beforeItem(null, coords, item); + this.triggers.beforeItem(null, coords, item, environment); this.queueDelay(function () { // create the context object for scripts to run