Skip to content

Commit

Permalink
added workaround for failing test case on expo-image
Browse files Browse the repository at this point in the history
  • Loading branch information
fullstackninja864 committed Mar 28, 2024
1 parent 97cf76e commit 80d5ac6
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 226 deletions.
8 changes: 8 additions & 0 deletions __mocks__/expo-image.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {
Image as RNImage,
ImageBackground as RNImageBackground,
} from 'react-native';

// TODO remove when https://github.com/expo/expo/issues/26087 is resolved
export const ImageBackground = RNImageBackground;
export const Image = RNImage;
13 changes: 13 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,16 @@ jest.mock("expo-linking", () => {

return module;
});

global.window.matchMedia = global.matchMedia || function (query) {
return {
matches: false,
media: query,
onchange: null,
addListener: jest.fn(), // deprecated
removeListener: jest.fn(), // deprecated
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn(),
};
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 80d5ac6

Please sign in to comment.