react-native/jest
Rubén Norte ec3327b61a Fix AccessibilityInfo mock to always return a promise in isScreenReaderEnabled
Summary:
`AccessibilityInfo.isScreenReaderEnabled().then()` fails by default in tests because that function is mocked and it doesn't return a promise (the default return value is `undefined`). Returning `Promise.resolve(false)` is a good default in this case so it doesn't break any code relying on it.

Changelog: [General] [Fixed] - Fix `AccessibilityInfo.isScreenReaderEnabled` mock in Jest setup

Reviewed By: lunaleaps, motiz88

Differential Revision: D19972921

fbshipit-source-id: 3c8498d5aeeac54d1f5cf333ae39658e22c180a1
2020-02-20 06:43:09 -08:00
..
assetFileTransformer.js Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
mockComponent.js use requireActual and requireMock from jest instead of require (#21849) 2018-10-18 15:32:15 -07:00
MockNativeMethods.js change jest native method mocks to jest functions (#24337) 2019-04-07 11:54:48 -07:00
preprocessor.js exact-by-default in xplat/js 2019-12-09 11:03:21 -08:00
renderer.js Add UI tests for LogBox 2019-10-21 21:08:03 -07:00
setup.js Fix AccessibilityInfo mock to always return a promise in isScreenReaderEnabled 2020-02-20 06:43:09 -08:00