coinjar/react-native-wagmi-charts

TypeError: Cannot read properties of undefined (reading 'Provider') - Jest

cyberkaidev opened this issue · 3 comments

I'm trying to do a test, but it's giving this error and I don't know how to solve it.
My test:

test('Render component without load', () => {
  const { getByTestId } = render(<Chart data={configTest.data} isLoading={false} />);
  
  expect(getByTestId(configTest.id)).toBeTruthy();
});

Result:

TypeError: Cannot read properties of undefined (reading 'Provider')

   12 |                      {!isLoading && (
> 13 |                              <LineChart.Provider data={data}>
        |                                         ^
   14 |                                      <LineChart height={250}>
   15 |                                              <LineChart.Path color={themes.colors.purple_100}>
   16 |                                                      <LineChart.Gradient />

Having a similar issue

Anything on this? I'm having a similar issue.

Anything on this? I'm having a similar issue.

No, I migrated to another lib