This message was deleted.
# announcements
w
This message was deleted.
b
when you create an SDK connection you'll get a client key and API host you can use to configure the SDK. if you make a request to the endpoint, you can see what this JSON looks like. if you want to add this to your tests without making network calls (and impacting your usage of the growthbook API's) you can save the file as JSON, import/require it into your tests, and call
setFeatures(theJson)
on the SDK or pass it to your Context. here's an example where we set mock features in our react tests. let us know if you need anymore info.
s
Tisha Murvihill [7:59 AM] Thank you Tina, I love it that you can mock flags for the unit tests in react. Thank you for the tip! We do want to run the tests with the current actual state of the flags, rather than a mocked state. I was able to get what I needed just from the returned JSON. I got confused thinking I needed to specify the environment, but it was already specified in the config that was set up by another dev. Now I understand how it works! Thank you for the response.
🙌 1
b
awesome! glad it's all figured out.
148 Views