Jest Constants.manifest.extra undefined

After upgrading from 45 to 46 Constants.manifest.extra is now undefined only when running my Jest tests. Does anyone have any idea as to why this would break between versions. I can’t see anything mentioned in the upgrade notes.

Hey @markybry,

Are you using [jest-expo] (expo/packages/jest-expo at main · expo/expo · GitHub)? If you can, please share a minimal reproducible example so that I can clone it on my end and see what could be the issue.

That’s right I am using jest-expo. Here is a link to a minimal reproduction of the issue.

1 Like

Thanks for sharing it. Let me try and I’ll get back to you.

1 Like

The best i could do to get it working was to mock expo-constants. I’m not sure really what I should be doing going forward though. I am confused around when to use expo-constants , expo-updates, manifest and manifest2 . Also it is unclear which packages support what seems to be the new method. Auth session has a load of code to handle legacy config which looks quite horrible. I mostly do behaviour driven dev and my tests are therefore are low on mocking and are focused on testing the whole feature at the boundaries of any given context.

I’m not all sure what the expo team are trying to achieve with the expo-constants changes.

jest.mock('expo-constants', () => {

  return {
    "name": "eMar",
    ExecutionEnvironment: "standalone",
    expoConfig: {
      currentFullName: '@ourUser/ourAppName',
      originalFullName: '@ourUser/ourAppName',
    },
    manifest: {
      version: '1.0.0',
      extra: {
        configChannel: "development",
      }

    }
  };
})