bruno icon indicating copy to clipboard operation
bruno copied to clipboard

Disable tests when executing a request or during a run

Open zlinks opened this issue 1 month ago • 2 comments

I have checked the following:

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

This feature

  • [ ] blocks me from using Bruno
  • [x] would improve my quality of life in Bruno
  • [ ] is something I've never seen an API client do before

Describe the feature you want to add, and how it would change your usage of Bruno

Is it possible to disable tests when executing a request or during a run?

Currently as a work around I can clone the request and remove the tests. Excluding the request using tags will not work for me , as I want the the request to run

zlinks avatar Nov 12 '25 10:11 zlinks

Hey @zlinks '

Could you expand on your use case? As in, why would you want to disable the tests when running the request?

helloanoop avatar Nov 12 '25 13:11 helloanoop

Hi @helloanoop sometimes I need a quick answer , like only checking the response time along with a HTTP 200 status since tests can be time consuming.

After searching a bit more I managed to do it by using env variables and some if checks in the test script of my requests:

Variables: Image

Sample script: Image

zlinks avatar Nov 14 '25 10:11 zlinks

After searching a bit more I managed to do it by using env variables and some if checks in the test script of my requests:

Thanks for this idea! I set the tests to only run when the env is set to "test":

if (bru.getEnvName() !== 'test') {

  console.log(`"${req.getMethod()} ${req.getName()}": tests skipped - switch to test env to run tests`)

} else {

  test('GET /health should succeed', () => {
    expect(res.getStatus()).to.equal(200);
  })

}

GeoffreyEmerson avatar Nov 22 '25 23:11 GeoffreyEmerson