Disable tests when executing a request or during a run
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
Hey @zlinks '
Could you expand on your use case? As in, why would you want to disable the tests when running the request?
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:
Sample script:
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);
})
}