|
14 | 14 | # Start in tasks/ even if run from root directory
|
15 | 15 | cd "$(dirname "$0")"
|
16 | 16 |
|
17 |
| -# CLI and app temporary locations |
| 17 | +# CLI, app, and test module temporary locations |
18 | 18 | # http://unix.stackexchange.com/a/84980
|
19 | 19 | temp_cli_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_cli_path'`
|
20 | 20 | temp_app_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_app_path'`
|
| 21 | +temp_module_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_module_path'` |
21 | 22 |
|
22 | 23 | function cleanup {
|
23 | 24 | echo 'Cleaning up.'
|
24 | 25 | ps -ef | grep 'react-scripts' | grep -v grep | awk '{print $2}' | xargs kill -s 9
|
25 | 26 | cd "$root_path"
|
26 | 27 | # TODO: fix "Device or resource busy" and remove ``|| $CI`
|
27 |
| - rm -rf "$temp_cli_path" $temp_app_path || $CI |
| 28 | + rm -rf "$temp_cli_path" "$temp_app_path" "$temp_module_path" || $CI |
28 | 29 | }
|
29 | 30 |
|
30 | 31 | # Error messages are redirected to stderr
|
@@ -111,17 +112,24 @@ npm install "$cli_path"
|
111 | 112 | cd $temp_app_path
|
112 | 113 | create_react_app --scripts-version="$scripts_path" --internal-testing-template="$root_path"/packages/react-scripts/fixtures/kitchensink test-kitchensink
|
113 | 114 |
|
| 115 | +# Install the test module |
| 116 | +cd "$temp_module_path" |
| 117 | +npm install test-integrity@^2.0.1 |
| 118 | + |
114 | 119 | # ******************************************************************************
|
115 | 120 | # Now that we used create-react-app to create an app depending on react-scripts,
|
116 | 121 | # let's make sure all npm scripts are in the working state.
|
117 | 122 | # ******************************************************************************
|
118 | 123 |
|
119 | 124 | # Enter the app directory
|
120 |
| -cd test-kitchensink |
| 125 | +cd "$temp_app_path/test-kitchensink" |
121 | 126 |
|
122 | 127 | # Link to our preset
|
123 | 128 | npm link "$root_path"/packages/babel-preset-react-app
|
124 | 129 |
|
| 130 | +# Link to test module |
| 131 | +npm link "$temp_module_path/node_modules/test-integrity" |
| 132 | + |
125 | 133 | # Test the build
|
126 | 134 | REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
|
127 | 135 | NODE_PATH=src \
|
@@ -183,6 +191,9 @@ npm link "$root_path"/packages/eslint-config-react-app
|
183 | 191 | npm link "$root_path"/packages/react-dev-utils
|
184 | 192 | npm link "$root_path"/packages/react-scripts
|
185 | 193 |
|
| 194 | +# Link to test module |
| 195 | +npm link "$temp_module_path/node_modules/test-integrity" |
| 196 | + |
186 | 197 | # Test the build
|
187 | 198 | REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
|
188 | 199 | NODE_PATH=src \
|
|
0 commit comments