mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
* Add activity indicator to fetch location * Add e2e location mock (#643) Adds a mock for fetchUserLocation intended to be used with e2e tests. `MOCK_MODE=e2e` must be in the ENV for this to work. --------- Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com> --------- Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com> Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
35 lines
916 B
JavaScript
35 lines
916 B
JavaScript
/**
|
|
* Metro configuration for React Native
|
|
* https://github.com/facebook/react-native
|
|
* with added config for react-native-svg-transformer
|
|
* https://www.npmjs.com/package/react-native-svg-transformer?activeTab
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
const { getDefaultConfig } = require( "metro-config" );
|
|
|
|
module.exports = ( async () => {
|
|
const {
|
|
resolver: { sourceExts, assetExts }
|
|
} = await getDefaultConfig();
|
|
return {
|
|
transformer: {
|
|
getTransformOptions: async () => ( {
|
|
transform: {
|
|
experimentalImportSupport: false,
|
|
inlineRequires: true
|
|
}
|
|
} ),
|
|
babelTransformerPath: require.resolve( "react-native-svg-transformer" )
|
|
},
|
|
resolver: {
|
|
assetExts: assetExts.filter( ext => ext !== "svg" ),
|
|
sourceExts:
|
|
process.env.MOCK_MODE === "e2e"
|
|
? ["e2e-mock.js", ...sourceExts, "svg"]
|
|
: [...sourceExts, "svg"]
|
|
}
|
|
};
|
|
} )();
|