From 91846ab352804871f309635ac8166f236dda1453 Mon Sep 17 00:00:00 2001 From: Tim Nikischin <49103409+nikischin@users.noreply.github.com> Date: Thu, 26 Sep 2024 19:39:07 +0200 Subject: [PATCH 1/3] Include getExecutionMode in docs Added docs for req.getExecutionMode() --- src/pages/scripting/javascript-reference.mdx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/pages/scripting/javascript-reference.mdx b/src/pages/scripting/javascript-reference.mdx index 29bf798..a3824c7 100644 --- a/src/pages/scripting/javascript-reference.mdx +++ b/src/pages/scripting/javascript-reference.mdx @@ -100,6 +100,17 @@ Set the maximum number of redirects to follow req.setMaxRedirects(5); ``` +### `getExecutionMode` +Get's the current active execution mode. + +Returns `runner` or `standalone` + +**Example** +```javascript +const mode = req.getExecutionMode(); +``` + + ## Response This `res` variable is available inside your scripting and testing context. @@ -276,4 +287,4 @@ You can also abort the run by explicitly setting the next request to `null` **Example:** ```javascript bru.setNextRequest(null); // aborts the run gracefully -``` \ No newline at end of file +``` From d7bc092cc53d0226f8dedfb433cf0b5cb7dc0d1f Mon Sep 17 00:00:00 2001 From: Tim Nikischin <49103409+nikischin@users.noreply.github.com> Date: Thu, 26 Sep 2024 19:45:33 +0200 Subject: [PATCH 2/3] Include future changes of getExecutionPlatform already Implements the changes expected with getExecutionPlatform --- src/pages/scripting/javascript-reference.mdx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pages/scripting/javascript-reference.mdx b/src/pages/scripting/javascript-reference.mdx index a3824c7..34a3915 100644 --- a/src/pages/scripting/javascript-reference.mdx +++ b/src/pages/scripting/javascript-reference.mdx @@ -101,7 +101,7 @@ req.setMaxRedirects(5); ``` ### `getExecutionMode` -Get's the current active execution mode. +Get the current active execution mode Returns `runner` or `standalone` @@ -110,6 +110,16 @@ Returns `runner` or `standalone` const mode = req.getExecutionMode(); ``` +### `getExecutionPlatform` +Get the plattform the current request is ran on + +Returns `app` or `cli` + +**Example** +```javascript +const mode = req.getExecutionPlatform(); +``` + ## Response This `res` variable is available inside your scripting and testing context. From f95ea6dd9092c071a921966586be77d3bf28d59c Mon Sep 17 00:00:00 2001 From: Tim Nikischin <49103409+nikischin@users.noreply.github.com> Date: Thu, 26 Sep 2024 20:07:22 +0200 Subject: [PATCH 3/3] Update javascript-reference.mdx --- src/pages/scripting/javascript-reference.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/scripting/javascript-reference.mdx b/src/pages/scripting/javascript-reference.mdx index 34a3915..090476d 100644 --- a/src/pages/scripting/javascript-reference.mdx +++ b/src/pages/scripting/javascript-reference.mdx @@ -111,7 +111,7 @@ const mode = req.getExecutionMode(); ``` ### `getExecutionPlatform` -Get the plattform the current request is ran on +Get the plattform the request is running on Returns `app` or `cli`