Open jgeorge-benchling opened 2 years ago
If the native module isn't set up correctly then you could experience this error. LaunchArguments should always be present in your build, so using ? will surpress any potential configuration errors.
Had the same error in my jest tests.
I added this to my jest.setup.ts
to solve that issue
jest.mock('react-native-launch-arguments', () => {
return {
LaunchArguments: {
value: jest.fn().mockReturnValue({}),
},
};
});
Hi there, My tests in CI are failing with the error:
Please, could you add optional chaining to the second line of the code below:
const raw = NativeModules.LaunchArguments.value;
will beconst raw = NativeModules.LaunchArguments?.value;
This will remove the TypeError that I get in CI.