refactor: update Bru constructor to accept a single options obj for improved readability (#7562)

* refactor: update Bru constructor to accept a single options object for improved readability

- Changed the Bru class constructor to accept a single options object instead of multiple parameters, enhancing code clarity and maintainability.
- Updated all instances of Bru instantiation across the codebase to align with the new constructor format.

* docs: enhance Bru constructor documentation with additional certs and proxy configuration options

- Updated the documentation for the Bru class constructor to include new parameters related to certs and proxy configuration, improving clarity for users on available options.
- Added descriptions for collectionPath, options, clientCertificates, collectionLevelProxy, and systemProxyConfig to provide comprehensive guidance on their usage.

* docs: refine Bru constructor documentation for clarity and default values

- Updated the constructor documentation for the Bru class to enhance clarity by consolidating parameter descriptions into a single options object format.
- Added default values for optional parameters, improving guidance for users on expected input and usage.
This commit is contained in:
sanish chirayath
2026-03-27 18:56:09 +05:30
committed by GitHub
parent 708e88241f
commit 784e851d4c
6 changed files with 103 additions and 46 deletions

View File

@@ -36,7 +36,21 @@ class TestRuntime {
const assertionResults = request?.assertionResults || [];
const certsAndProxyConfig = request?.certsAndProxyConfig;
const scriptPath = request?.pathname;
const bru = new Bru(this.runtime, envVariables, runtimeVariables, processEnvVars, collectionPath, collectionVariables, folderVariables, requestVariables, globalEnvironmentVariables, oauth2CredentialVariables, collectionName, promptVariables, certsAndProxyConfig);
const bru = new Bru({
runtime: this.runtime,
envVariables,
runtimeVariables,
processEnvVars,
collectionPath,
collectionVariables,
folderVariables,
requestVariables,
globalEnvironmentVariables,
oauth2CredentialVariables,
collectionName,
promptVariables,
certsAndProxyConfig
});
const req = new BrunoRequest(request);
const res = new BrunoResponse(response);