From 7de74b129d62bfd6d02470d2b01713d40f840684 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Thu, 23 Apr 2015 09:41:45 -0700 Subject: [PATCH] [ReactNative] Move NativeModules mock to OSS --- .../__mocks__/NativeModules.js | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Libraries/BatchedBridge/BatchedBridgedModules/__mocks__/NativeModules.js diff --git a/Libraries/BatchedBridge/BatchedBridgedModules/__mocks__/NativeModules.js b/Libraries/BatchedBridge/BatchedBridgedModules/__mocks__/NativeModules.js new file mode 100644 index 0000000000..28da1bc321 --- /dev/null +++ b/Libraries/BatchedBridge/BatchedBridgedModules/__mocks__/NativeModules.js @@ -0,0 +1,44 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + */ +'use strict'; + +var NativeModules = { + I18n: { + translationsDictionary: { + 'Good bye, {name}!|Bye message': '¡Adiós {name}!', + }, + }, + Timing: { + createTimer: jest.genMockFunction(), + deleteTimer: jest.genMockFunction(), + }, + GraphPhotoUpload: { + upload: jest.genMockFunction(), + }, + FacebookSDK: { + login: jest.genMockFunction(), + logout: jest.genMockFunction(), + queryGraphPath: jest.genMockFunction().mockImpl( + (path, method, params, callback) => callback() + ), + }, + DataManager: { + queryData: jest.genMockFunction(), + }, + UIManager: { + customBubblingEventTypes: {}, + customDirectEventTypes: {}, + }, + AsyncLocalStorage: { + getItem: jest.genMockFunction(), + setItem: jest.genMockFunction(), + removeItem: jest.genMockFunction(), + clear: jest.genMockFunction(), + }, + SourceCode: { + scriptURL: null, + }, +}; + +module.exports = NativeModules;