@@ -110,8 +110,11 @@ create_react_app --scripts-version=$scripts_path --internal-testing-template=$ro
110
110
# Enter the app directory
111
111
cd test-kitchensink
112
112
113
+ # Link to our preset
114
+ npm link $root_path /packages/babel-preset-react-app
115
+
113
116
# Test the build
114
- NODE_PATH=src REACT_APP_SHELL_ENV_MESSAGE=fromtheshell npm run build
117
+ NODE_PATH=src NODE_ENV=test REACT_APP_SHELL_ENV_MESSAGE=fromtheshell npm run build
115
118
# Check for expected output
116
119
test -e build/* .html
117
120
test -e build/static/js/main.* .js
@@ -120,24 +123,28 @@ test -e build/static/js/main.*.js
120
123
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
121
124
CI=true \
122
125
NODE_PATH=src \
126
+ NODE_ENV=test \
123
127
npm test -- --no-cache --testPathPattern=" /src/"
124
128
125
129
# Test "development" environment
126
130
tmp_server_log=` mktemp`
127
131
PORT=3001 \
128
132
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
129
133
NODE_PATH=src \
134
+ NODE_ENV=development \
130
135
nohup npm start & > $tmp_server_log &
131
136
grep -q ' The app is running at:' <( tail -f $tmp_server_log )
132
137
E2E_URL=" http://localhost:3001" \
133
138
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
134
139
CI=true NODE_PATH=src \
140
+ NODE_ENV=development \
135
141
node node_modules/.bin/mocha --require babel-register --require babel-polyfill integration/* .test.js
136
142
137
143
# Test "production" environment
138
144
E2E_FILE=./build/index.html \
139
145
CI=true \
140
146
NODE_PATH=src \
147
+ NODE_ENV=production \
141
148
node_modules/.bin/mocha --require babel-register --require babel-polyfill integration/* .test.js
142
149
143
150
# ******************************************************************************
@@ -153,7 +160,7 @@ npm link $root_path/packages/eslint-config-react-app
153
160
npm link $root_path /packages/react-dev-utils
154
161
npm link $root_path /packages/react-scripts
155
162
156
- # ...and we need to remove template's .babelrc
163
+ # ...and we need to remove template's .babelrc
157
164
rm .babelrc
158
165
159
166
# Test the build
@@ -166,19 +173,21 @@ test -e build/static/js/main.*.js
166
173
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
167
174
CI=true \
168
175
NODE_PATH=src \
176
+ NODE_ENV=test \
169
177
npm test -- --no-cache --testPathPattern=" /src/"
170
178
171
179
# Test "development" environment
172
180
tmp_server_log=` mktemp`
173
181
PORT=3002 \
174
182
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
175
183
NODE_PATH=src \
184
+ NODE_ENV=development \
176
185
nohup npm start & > $tmp_server_log &
177
186
grep -q ' The app is running at:' <( tail -f $tmp_server_log )
178
187
E2E_URL=" http://localhost:3002" \
179
188
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
180
189
CI=true NODE_PATH=src \
181
- NODE_ENV=production \
190
+ NODE_ENV=development \
182
191
node_modules/.bin/mocha --require babel-register --require babel-polyfill integration/* .test.js
183
192
184
193
# Test "production" environment
0 commit comments