Skip to content

Commit

Permalink
Use react-app preset
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Feb 5, 2017
1 parent 247e598 commit 50b503e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
3 changes: 1 addition & 2 deletions packages/react-scripts/fixtures/kitchensink/.babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"presets": ["latest"],
"plugins": ["transform-class-properties"]
"presets": ["react-app"]
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"dependencies": {
"babel-preset-latest": "6.16.0",
"babel-register": "6.22.0",
"babel-polyfill": "6.20.0",
"babel-plugin-transform-class-properties": "6.22.0",
"chai": "3.5.0",
"jsdom": "9.8.3",
"mocha": "3.2.0"
Expand Down
15 changes: 12 additions & 3 deletions tasks/e2e-kitchensink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ create_react_app --scripts-version=$scripts_path --internal-testing-template=$ro
# Enter the app directory
cd test-kitchensink

# Link to our preset
npm link $root_path/packages/babel-preset-react-app

# Test the build
NODE_PATH=src REACT_APP_SHELL_ENV_MESSAGE=fromtheshell npm run build
NODE_PATH=src NODE_ENV=test REACT_APP_SHELL_ENV_MESSAGE=fromtheshell npm run build
# Check for expected output
test -e build/*.html
test -e build/static/js/main.*.js
Expand All @@ -120,24 +123,28 @@ test -e build/static/js/main.*.js
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
CI=true \
NODE_PATH=src \
NODE_ENV=test \
npm test -- --no-cache --testPathPattern="/src/"

# Test "development" environment
tmp_server_log=`mktemp`
PORT=3001 \
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
NODE_PATH=src \
NODE_ENV=development \
nohup npm start &>$tmp_server_log &
grep -q 'The app is running at:' <(tail -f $tmp_server_log)
E2E_URL="http://localhost:3001" \
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
CI=true NODE_PATH=src \
NODE_ENV=development \
node node_modules/.bin/mocha --require babel-register --require babel-polyfill integration/*.test.js

# Test "production" environment
E2E_FILE=./build/index.html \
CI=true \
NODE_PATH=src \
NODE_ENV=production \
node_modules/.bin/mocha --require babel-register --require babel-polyfill integration/*.test.js

# ******************************************************************************
Expand All @@ -153,7 +160,7 @@ npm link $root_path/packages/eslint-config-react-app
npm link $root_path/packages/react-dev-utils
npm link $root_path/packages/react-scripts

# ...and we need to remove template's .babelrc
# ...and we need to remove template's .babelrc
rm .babelrc

# Test the build
Expand All @@ -166,19 +173,21 @@ test -e build/static/js/main.*.js
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
CI=true \
NODE_PATH=src \
NODE_ENV=test \
npm test -- --no-cache --testPathPattern="/src/"

# Test "development" environment
tmp_server_log=`mktemp`
PORT=3002 \
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
NODE_PATH=src \
NODE_ENV=development \
nohup npm start &>$tmp_server_log &
grep -q 'The app is running at:' <(tail -f $tmp_server_log)
E2E_URL="http://localhost:3002" \
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
CI=true NODE_PATH=src \
NODE_ENV=production \
NODE_ENV=development \
node_modules/.bin/mocha --require babel-register --require babel-polyfill integration/*.test.js

# Test "production" environment
Expand Down

0 comments on commit 50b503e

Please sign in to comment.