mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-06 17:34:07 +08:00
Remove out-of-tree platform tests (#24536)
Summary: This pull request removes the tests for out-of-tree platforms and the dependency on the package `react-native-dummy` from the React Native repo. The logic that this was meant to test was moved to the React Native CLI repo, and [it is being tested there](827daa4c16/packages/cli/src/tools/config/__tests__/index-test.js (L125-L152)) as well making this a bit redundant at this point. The dependency on `react-native-dummy` was also an issue, because when the file structure under `Libraries/` changes, bundler errors could crop up if there wasn't an update made to the file structure of `react-native-dummy/Libraries/`. This was an issue when [`TabBarIOS` was removed](02697291ff (diff-b9cfc7f2cdf78a7f4b91a753d10865a2)) - `react-native-dummy` was causing Haste errors and was stopping the commit from being able to land, and I needed to cut a new version just for it. With Lean Core, I expect more issues like this happening in the future. [General] [Removed] - Removed Out-of-Tree platform tests (functionality is tested in the RN-CLI repo now) Pull Request resolved: https://github.com/facebook/react-native/pull/24536 Differential Revision: D15063320 Pulled By: cpojer fbshipit-source-id: 2a0467bed326b286623fa3cfa4e0bb6959b66b78
This commit is contained in:
committed by
Facebook Github Bot
parent
954f715b25
commit
b27d1d3da2
@@ -22,8 +22,6 @@ AVD_UUID=$(< /dev/urandom tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)
|
||||
ANDROID_NPM_DEPS="appium@1.5.1 mocha@2.4.5 wd@0.3.11 colors@1.0.3 pretty-data2@0.40.1"
|
||||
CLI_PACKAGE="$ROOT/react-native-cli/react-native-cli-*.tgz"
|
||||
PACKAGE="$ROOT/react-native-*.tgz"
|
||||
# Version of react-native-dummy to test against
|
||||
REACT_DUMMY_PLATFORM=react-native-dummy@0.1.0
|
||||
|
||||
# solve issue with max user watches limit
|
||||
echo 65536 | tee -a /proc/sys/fs/inotify/max_user_watches
|
||||
@@ -250,20 +248,6 @@ function e2e_suite() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! retry "$RETRY_COUNT" npm install --save "$REACT_DUMMY_PLATFORM" --silent >> /dev/null
|
||||
then
|
||||
echo "Failed to install react-native-dummy"
|
||||
echo "Most common reason is npm registry connectivity, try again"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! react-native bundle --max-workers 1 --platform dummy --dev true --entry-file index.js --bundle-output dummy-bundle.js
|
||||
then
|
||||
echo "Could not build dummy bundle"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# directory cleanup
|
||||
rm "$IOS_MARKER"
|
||||
rm "$ANDROID_MARKER"
|
||||
|
||||
@@ -11,23 +11,9 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const {getHasteName} = require('../hasteImpl');
|
||||
|
||||
// RNPM currently does not support plugins when using Yarn Plug 'n Play
|
||||
const testIfNotPnP = fs.existsSync(
|
||||
path.join(
|
||||
__dirname,
|
||||
'../..',
|
||||
'node_modules',
|
||||
'react-native-dummy',
|
||||
'package.json',
|
||||
),
|
||||
)
|
||||
? test
|
||||
: test.skip;
|
||||
|
||||
function getPath(...parts) {
|
||||
return path.join(__dirname, '..', '..', ...parts);
|
||||
}
|
||||
@@ -60,24 +46,6 @@ it('returns the correct haste name for a file with a platform suffix', () => {
|
||||
}
|
||||
});
|
||||
|
||||
testIfNotPnP(
|
||||
'returns the correct haste name for a file with an out-of-tree platform suffix',
|
||||
() => {
|
||||
for (const platform of ['dummy']) {
|
||||
expect(
|
||||
getHasteName(
|
||||
getPath(
|
||||
'Libraries',
|
||||
'Components',
|
||||
'AccessibilityInfo',
|
||||
`AccessibilityInfo.${platform}.js`,
|
||||
),
|
||||
),
|
||||
).toEqual('AccessibilityInfo');
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it('returns the correct haste name for a file with a flow suffix', () => {
|
||||
expect(
|
||||
getHasteName(
|
||||
|
||||
@@ -141,7 +141,6 @@
|
||||
"mkdirp": "^0.5.1",
|
||||
"prettier": "1.16.4",
|
||||
"react": "16.8.3",
|
||||
"react-native-dummy": "0.2.0",
|
||||
"react-test-renderer": "16.8.3",
|
||||
"shelljs": "^0.7.8",
|
||||
"yargs": "^9.0.0",
|
||||
|
||||
Reference in New Issue
Block a user