forked from babel/babel
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
e2e-create-react-app.sh
executable file
·55 lines (41 loc) · 1.91 KB
/
e2e-create-react-app.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
#==============================================================================#
# SETUP #
#==============================================================================#
# Start in scripts/integration-tests/ even if run from root directory
cd "$(dirname "$0")" || exit
source utils/local-registry.sh
source utils/cleanup.sh
# Echo every command being executed
set -x
# Clone create-react-app
git clone --depth=1 https://github.com/facebook/create-react-app.git tmp/create-react-app
cd tmp/create-react-app || exit
#==============================================================================#
# TEST #
#==============================================================================#
# !!! WARNING !!!
# create-react-app uses the useBuiltIns: true option of @babel/preset-react,
# removed in Babel 8.0.0. And it does not specify runtime option. The test will break on
# runtime: "automatic", default of Babel 8.
# This change replaces useBuiltIns: true with runtime: "classic"
sed -i 's/useBuiltIns: true/runtime: "classic"/' packages/babel-preset-react-app/create.js
# create-react-app throws if `@babel/eslint-parser` is not pinned, but we
# must upgrade it for test purposes
sed -i "s#'@babel/eslint-parser',##" packages/react-scripts/scripts/utils/verifyPackageTree.js
# remove this line when https://github.com/facebook/create-react-app/pull/11216 gets merged
sed -i "s#isESLintPluginEnabled && 'babel-eslint',##" packages/react-scripts/scripts/utils/verifyPackageTree.js
bump_deps="$PWD/../../utils/bump-babel-dependencies.js"
node "$bump_deps"
for d in ./packages/*/
do
(cd "$d"; node "$bump_deps")
done
# Don't use Yarn 2
export YARN_IGNORE_PATH=1
startLocalRegistry "$PWD"/../../verdaccio-config.yml
yarn install
# Test
CI=true yarn test
unset YARN_IGNORE_PATH
cleanup