0

I am having trouble getting tests up and running with Jest for my react-native app (expo). This is the simple test I am trying:

import React from 'react';
import renderer from 'react-test-renderer';

import App from '../App';

describe('<App />', () => {

  it('has 1 child', async () => {
    jest.useFakeTimers()
    const tree = await renderer.create(<App />).toJSON();
    expect(tree.children.length).toBe(1);
  });
});

And this is the error I am getting:

C:\Users\user01\github\seize-the-night\node_modules\expo-sqlite\build\SQLite.js:49
        callback(null, nativeResultSets.map(_deserializeResultSet));
                                        ^

TypeError: Cannot read properties of undefined (reading 'map')
    at C:\Users\user01\github\seize-the-night\node_modules\expo-sqlite\src\SQLite.ts:68:31
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

The app uses a expo-sqlite database. This is causing the error. I would be grateful for any help.

Neil
  • 706
  • 8
  • 23

0 Answers0