Fix image import mocking
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
module.exports = {
|
||||
preset: '@testing-library/react-native',
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
|
||||
moduleNameMapper: {
|
||||
'\\.(png)$': require.resolve('./test/file-mock.js'),
|
||||
},
|
||||
setupFilesAfterEnv: ['./test/jest-setup.js'],
|
||||
transformIgnorePatterns: [
|
||||
'node_modules/(?!((jest-)?react-native(-.*)?|@react-native(-community)?)/)',
|
||||
|
||||
@@ -60,7 +60,7 @@ exports[`Stats screen when provided data, renders stats 1`] = `
|
||||
}
|
||||
>
|
||||
<Image
|
||||
source="image"
|
||||
source={123}
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
|
||||
@@ -6,7 +6,6 @@ import Stats from '../../components/stats'
|
||||
jest.mock('../../components/common/AppHelp', () => 'AppHelp')
|
||||
jest.mock('../../components/common/StatsOverview', () => 'StatsOverview')
|
||||
jest.mock('../../components/common/StatsTable', () => 'StatsTable')
|
||||
jest.mock('../../assets/cycle-icon.png', () => 'image')
|
||||
|
||||
const mockGetAllCycleLengths = jest
|
||||
.fn()
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = 123
|
||||
Reference in New Issue
Block a user