@@ -110,8 +110,11 @@ create_react_app --scripts-version=$scripts_path --internal-testing-template=$ro
110110# Enter the app directory
111111cd test-kitchensink
112112
113+ # Link to our preset
114+ npm link $root_path /packages/babel-preset-react-app
115+
113116# 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
115118# Check for expected output
116119test -e build/* .html
117120test -e build/static/js/main.* .js
@@ -120,24 +123,28 @@ test -e build/static/js/main.*.js
120123REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
121124 CI=true \
122125 NODE_PATH=src \
126+ NODE_ENV=test \
123127 npm test -- --no-cache --testPathPattern=" /src/"
124128
125129# Test "development" environment
126130tmp_server_log=` mktemp`
127131PORT=3001 \
128132 REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
129133 NODE_PATH=src \
134+ NODE_ENV=development \
130135 nohup npm start & > $tmp_server_log &
131136grep -q ' The app is running at:' <( tail -f $tmp_server_log )
132137E2E_URL=" http://localhost:3001" \
133138 REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
134139 CI=true NODE_PATH=src \
140+ NODE_ENV=development \
135141 node node_modules/.bin/mocha --require babel-register --require babel-polyfill integration/* .test.js
136142
137143# Test "production" environment
138144E2E_FILE=./build/index.html \
139145 CI=true \
140146 NODE_PATH=src \
147+ NODE_ENV=production \
141148 node_modules/.bin/mocha --require babel-register --require babel-polyfill integration/* .test.js
142149
143150# ******************************************************************************
@@ -153,7 +160,7 @@ npm link $root_path/packages/eslint-config-react-app
153160npm link $root_path /packages/react-dev-utils
154161npm link $root_path /packages/react-scripts
155162
156- # ...and we need to remove template's .babelrc
163+ # ...and we need to remove template's .babelrc
157164rm .babelrc
158165
159166# Test the build
@@ -166,19 +173,21 @@ test -e build/static/js/main.*.js
166173REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
167174 CI=true \
168175 NODE_PATH=src \
176+ NODE_ENV=test \
169177 npm test -- --no-cache --testPathPattern=" /src/"
170178
171179# Test "development" environment
172180tmp_server_log=` mktemp`
173181PORT=3002 \
174182 REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
175183 NODE_PATH=src \
184+ NODE_ENV=development \
176185 nohup npm start & > $tmp_server_log &
177186grep -q ' The app is running at:' <( tail -f $tmp_server_log )
178187E2E_URL=" http://localhost:3002" \
179188 REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
180189 CI=true NODE_PATH=src \
181- NODE_ENV=production \
190+ NODE_ENV=development \
182191 node_modules/.bin/mocha --require babel-register --require babel-polyfill integration/* .test.js
183192
184193# Test "production" environment
0 commit comments