Skip to content

Commit

Permalink
Get Appium + WebDriverIO + Mocha failing the first test
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewGable committed Oct 20, 2022
1 parent 87f4264 commit 42d8d0c
Show file tree
Hide file tree
Showing 14 changed files with 5,876 additions and 885 deletions.
71 changes: 7 additions & 64 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,66 +1,9 @@
require('dotenv').config();

const defaultPresets = ['@babel/preset-react', '@babel/preset-env', '@babel/preset-flow'];
const defaultPlugins = [
// Adding the commonjs: true option to react-native-web plugin can cause styling conflicts
['react-native-web'],

'@babel/transform-runtime',
'@babel/plugin-proposal-class-properties',

// We use `transform-class-properties` for transforming ReactNative libraries and do not use it for our own
// source code transformation as we do not use class property assignment.
'transform-class-properties',

// Keep it last
'react-native-reanimated/plugin',
];

const webpack = {
env: {
production: {
presets: defaultPresets,
plugins: [...defaultPlugins, 'transform-remove-console'],
},
development: {
presets: defaultPresets,
plugins: defaultPlugins,
},
},
};

const metro = {
presets: [require('metro-react-native-babel-preset')],
plugins: [
'react-native-reanimated/plugin',
module.exports = {
presets: [
['@babel/preset-env', {
targets: {
node: '16',
},
}],
],
};

/*
* We use Flipper, <React.Profiler> and react-native-performance to capture/monitor stats
* By default <React.Profiler> is disabled in production as it adds small overhead
* When CAPTURE_METRICS is set we're explicitly saying that we want to capture metrics
* To enable the <Profiler> for release builds we add these aliases */
if (process.env.CAPTURE_METRICS === 'true') {
const path = require('path');
const profilingRenderer = path.resolve(
__dirname,
'./node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling',
);

metro.plugins.push(['module-resolver', {
root: ['./'],
alias: {
'ReactNativeRenderer-prod': profilingRenderer,
'scheduler/tracing': 'scheduler/tracing-profiling',
},
}]);
}

module.exports = ({caller}) => {
// For `react-native` (iOS/Android) caller will be "metro"
// For `webpack` (Web) caller will be "@babel-loader"
// For `storybook` there won't be any config at all so we must give default argument of an empty object
const runningIn = caller((args = {}) => args.name);
return ['metro', 'babel-jest'].includes(runningIn) ? metro : webpack;
};
Loading

0 comments on commit 42d8d0c

Please sign in to comment.