Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ContainerShip/scripts/run-ci-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ AVD_UUID=$(cat /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
Expand Down Expand Up @@ -241,6 +243,19 @@ function e2e_suite() {
echo "Could not build iOS bundle"
return 1
fi

retry $RETRY_COUNT npm install --save $REACT_DUMMY_PLATFORM --silent >> /dev/null
if [ $? -ne 0 ]; then
echo "Failed to install react-native-dummy"
echo "Most common reason is npm registry connectivity, try again"
return 1
fi

react-native bundle --max-workers 1 --platform dummy --dev true --entry-file index.js --bundle-output dummy-bundle.js
if [ $? -ne 0 ]; then
echo "Could not build dummy bundle"
return 1
fi
fi

# directory cleanup
Expand Down
15 changes: 15 additions & 0 deletions jest/__tests__/hasteImpl-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ it('returns the correct haste name for a file with a platform suffix', () => {
}
});

it('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(
Expand Down
12 changes: 11 additions & 1 deletion jest/hasteImpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@
const path = require('path');
const findPlugins = require('../local-cli/core/findPlugins');

const plugins = findPlugins([path.resolve(__dirname, '../../../')]);
const REACT_NATIVE_CI = process.cwd() === path.resolve(__dirname, '..');

let pluginsPath;

if (REACT_NATIVE_CI) {
pluginsPath = '..';
} else {
pluginsPath = '../../../';
}

const plugins = findPlugins([path.resolve(__dirname, pluginsPath)]);

// Detect out-of-tree platforms and add them to the whitelists
const pluginRoots /*: Array<
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
"jest-junit": "5.1.0",
"prettier": "1.13.6",
"react": "16.5.0",
"react-native-dummy": "0.1.0",
"react-test-renderer": "16.5.0",
"shelljs": "^0.7.8",
"sinon": "^2.2.0"
Expand Down