From 65a8a515562e8688ce92872129082c30d86b091d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estev=C3=A3o=20Lucas?= Date: Mon, 18 Mar 2019 07:11:55 -0700 Subject: [PATCH] Add missing mock for AccessibilityInfo (#23982) Summary: I've realized after #23839 got merged, that `AccessibilityInfo` doesn't have a jest mock the same way as the other frameworks do. This PR adds the testing mock for `AccessibilityInfo`. Pull Request resolved: https://github.com/facebook/react-native/pull/23982 Differential Revision: D14502780 Pulled By: cpojer fbshipit-source-id: ec11bd547b6f90858e7f51ed8230c8d02dc4904c --- jest/setup.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/jest/setup.js b/jest/setup.js index 4bc9a7ad04..32499d2992 100644 --- a/jest/setup.js +++ b/jest/setup.js @@ -67,6 +67,19 @@ jest .mock('ensureComponentIsNative', () => () => true); const mockNativeModules = { + AccessibilityInfo: { + addEventListener: jest.fn(), + announceForAccessibility: jest.fn(), + fetch: jest.fn(), + isBoldTextEnabled: jest.fn(), + isGrayscaleEnabled: jest.fn(), + isInvertColorsEnabled: jest.fn(), + isReduceMotionEnabled: jest.fn(), + isReduceTransparencyEnabled: jest.fn(), + isScreenReaderEnabled: jest.fn(), + removeEventListener: jest.fn(), + setAccessibilityFocus: jest.fn(), + }, AlertManager: { alertWithArgs: jest.fn(), },