Hi! I'm trying to integrate Growthbook with my ex...
# ask-questions
l
Hi! I'm trying to integrate Growthbook with my existing test suite which is built with React-Native-Testing-Library. I've got about 800 tests that render various screens which contain the
GrowthBookProvider
- when running my tests I randomly get multiple
Warning: An update to GrowthBookProvider inside a test was not wrapped in act(...).
warnings. Has anyone else had this issue? Does anyone know how to get these messages to disappear?
f
Not super familiar with this stack, but did you try adjusting the act() calls to be of the form
await act (async () => {})?
l
Thanks for the quick response! I am already flushing effects, which fixes similar warnings for other libraries.
Copy code
renderRouter('src/app', { initialUrl });
  await act(async () => {
    await Promise.resolve();
  });
  // Added to try, but still get the errors even with a 50ms delay
  await waitFor(
    () => {
      // Intentionally empty; we're just waiting
    },
    { timeout: 50 }
  );
All network requests are mocked as well, so it can't be caused by GB waiting for a network response either