FeatureFuel
3

Override Environment for Testing a Request in Unit Tests

Source: Kong/insomnia#4626 · opened by @ceagan
If there was a way to provide an Environment JSON Object within a unit test to override other environment values, then it would be possible to create Unit Tests that reuse the same request, altering the call slightly by altering the environment variables referenced in the Request definition. This would make Requests much more useful from the perspective of Unit Tests and reduce the number of Requests required to build out a set of Unit Tests.

Consider a Request stored within a folder that defines the following environment for all Requests in that folder.



A Request in that folder might have a payload that references the date and amount in the environment like this:



The desired feature would enable the unit test to override the date variable in the environment for the duration of the unit test by doing something like this:



In the above example, the unit test would run with the date = "2022-10-10" and amount = "$20".

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests