https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
c

clever-beard-86995

10/26/2023, 8:43 PM
Hey! Could anyone link me to some example unit tests using jest?
1
r

rhythmic-agent-34208

10/26/2023, 8:43 PM
@blue-sundown-32899 has marked the issue as closed. Reopen Issue button
Hi Emily, thanks for reaching out! Are you asking about GrowthBook-specific unit tests? Could you tell me more about what types of things you'd want to test?
c

clever-beard-86995

10/26/2023, 9:12 PM
I want to test a feature flag I'm setting in growthbook and see if the UI is rendering correctly
@brief-honey-45610 bumping this for an update
r

rhythmic-agent-34208

10/26/2023, 11:12 PM
Hi Emily, I found we do have examples of using the GB SDK in jest here: https://github.com/growthbook/growthbook/tree/main/packages/sdk-js/test For DOM testing you can probably use JSDOM, or even think about browser-based tests like Playwright.
🙏 1
b

brief-honey-45610

10/27/2023, 4:33 PM
Hey @clever-beard-86995 was this what you needed? Anything else we can help with?
r

rhythmic-agent-34208

10/30/2023, 7:05 PM
Hi Emily, I'll go ahead and close this ticket now, but if something else comes up that we can help with please start a new thread in #ask-questions and we'll be happy to take a look!
19 Views