react-native-image-picker/jest.setup.js
Johan 11dcf311b7
V1.0.1 (#1120)
refactor: Replace JavaScript with TypeScript and AndroidX support
2019-07-09 10:09:00 +01:00

24 lines
582 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
/* eslint-env jest */
import {NativeModules} from 'react-native';
// Mock the ImagePickerManager native module to allow us to unit test the JavaScript code
NativeModules.ImagePickerManager = {
showImagePicker: jest.fn(),
launchCamera: jest.fn(),
launchImageLibrary: jest.fn(),
};
// Reset the mocks before each test
global.beforeEach(() => {
jest.resetAllMocks();
});