MCPcopy Create free account
hub / github.com/callstack/react-native-paper / mockAppearance

Function mockAppearance

src/core/__tests__/PaperProvider.test.tsx:49–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47}
48
49const mockAppearance = () => {
50 jest.mock('react-native/Libraries/Utilities/Appearance', () => {
51 const realApp = jest.requireActual(
52 'react-native/Libraries/Utilities/Appearance'
53 );
54 const listeners: Function[] = [];
55 return {
56 ...realApp,
57 addChangeListener: jest.fn((cb) => {
58 listeners.push(cb);
59 }),
60 removeChangeListener: jest.fn((cb) => {
61 listeners.push(cb);
62 }),
63 getColorScheme: jest.fn(() => {
64 return 'light';
65 }),
66 __internalListeners: listeners,
67 };
68 });
69};
70
71const mockAccessibilityInfo = () => {
72 jest.mock(

Callers 1

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…