How do I mock expo-sqlite?

Please provide the following:

  1. SDK Version: 4.13.0
  2. Platforms(Android/iOS/web/all): All
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

I’m trying to create a mock class in Jest for expo-sqlite so that I can test that my application business logic returns the correct value when given input from my database. However, despite me configuring Jest with “transformIgnorePatterns: [“node_modules/(?!(react-native|react-native-cookies)/)”]”, Jest complains:

"SyntaxError: Unexpected token ‘export’

  1 |
> 2 | const sqlite = jest.createMockFromModule("expo-sqlite");
    |                     ^
  3 | const userQuery = "SELECT * FROM ZUSERENTITY";
  4 | const placeQuery = "SELECT * FROM ZPLACEENTITY WHERE ZUSER=";
  5 | export class MockResultSet"

How do I resolve this issue?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.