From 9db0050635ff96edda28861e6f65a51be44605b2 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Sun, 30 Dec 2018 13:28:22 -0800 Subject: [PATCH] Fix Jest mocks Summary: Since we started relying on NativeModules' getConstants() method to access constants, we need to update our jest mocks of these NativeModules, so that the tests still pass. I do that in this diff. Reviewed By: fkgozali Differential Revision: D13561376 fbshipit-source-id: eaef3de82d842fd97d04be741d55bdded73c6a11 --- jest/setup.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jest/setup.js b/jest/setup.js index 1cb89755c..bc66b9161 100644 --- a/jest/setup.js +++ b/jest/setup.js @@ -115,6 +115,12 @@ const mockNativeModules = { BuildInfo: { appVersion: '0', buildVersion: '0', + getConstants() { + return { + appVersion: '0', + buildVersion: '0', + }; + }, }, Clipboard: { setString: jest.fn(),