Is it possible to programmatically change flag value? For testing different codepaths? #282
-
Hi all, I'm looking after Flagsmith and I find it very powerful, so far. There's one thing that I'm not able to understand, though: how can I manipulate flags values during unit tests? When testing my code I'd like to test all paths, with flag enabled and/or disabled. How should I do it using Flagsmith? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @paoloyx - thanks for the question - I've moved it to our Discussion area as its more relevant here. You can programatically drive Flagsmith via our API - more details here. Some of our users use the API to drive tests by modifying the Flagsmith flags for a particular test environment as part of the tests themselves. For particular languages, it would depend on what the most idiomatic way of implementing these code path changes would be - and that would depend on the language at hand. |
Beta Was this translation helpful? Give feedback.
Hi @paoloyx - thanks for the question - I've moved it to our Discussion area as its more relevant here.
You can programatically drive Flagsmith via our API - more details here. Some of our users use the API to drive tests by modifying the Flagsmith flags for a particular test environment as part of the tests themselves.
For particular languages, it would depend on what the most idiomatic way of implementing these code path changes would be - and that would depend on the language at hand.