Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Feature] provide version information of Bruno in JavaScript #3549

Open
1 task done
tho-gru-38 opened this issue Nov 26, 2024 · 0 comments
Open
1 task done

[New Feature] provide version information of Bruno in JavaScript #3549

tho-gru-38 opened this issue Nov 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@tho-gru-38
Copy link

I have checked the following:

  • I've searched existing issues and found nothing related to my issue.

Describe the feature you want to add

I want to make sure, that my collection is executed by a specific version of Bruno. Currently I want version 1.35.0 because this versions handle line comments correctly (issue #3216 is solved by this version).

I want to implement a test like to stop collection execution using bru.setNextRequest(null) if the version of Bruno does not fulfill the requirements.

My idea is that a new function like bru.getVersion() will return a string like "1.34.2" for Bruno version 1.34.2

With such a function the follwoing code can check if the minimum required version is used for executing a collection.

Mockups or Images of the feature

The following checks the version of Bruno and aborts collection run if Bruno is not at least version 1.34.2:

const minVersion = "1.34.2";
let versionOK;

test("Bruno version is ok", function () {
  versionOK = false;
  const currentVersionComponents = bru.getVersion().split(".");
  const requiredVersionComponents = minVersion.split(".");
  for (let i = 0; i < currentVersionComponents.length; i++) {
    expect(currentVersionComponents[i]).to.be.at.least(requiredVersionComponents[i]);
  }
  versionOK = true;
});

if (!versionOK) {
  test("abroting collection run", function() {
      throw new Error("Minimal version of Bruno must be at least " + minVersion);
    });
  bru.setNextRequest(null);
}
@tho-gru-38 tho-gru-38 added the enhancement New feature or request label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant