Skip to content

Commit

Permalink
Remove babelrc dependency for kitchensink test (#5098)
Browse files Browse the repository at this point in the history
* add kitchensink-eject to local-test

* add jest transform

Closes #5095
  • Loading branch information
Jack Zhao authored and Timer committed Sep 26, 2018
1 parent 725d388 commit 63398bd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
testEnvironment: 'node',
testMatch: ['**/integration/*.test.js'],
transform: { '^.+\\.js$': './jest.transform.js' },
};
3 changes: 3 additions & 0 deletions packages/react-scripts/fixtures/kitchensink/jest.transform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const babelOptions = { presets: ['react-app'] };

module.exports = require('babel-jest').createTransformer(babelOptions);
4 changes: 0 additions & 4 deletions tasks/e2e-kitchensink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ PORT=3001 \
nohup yarn start &>$tmp_server_log &
grep -q 'You can now view' <(tail -f $tmp_server_log)

# We haven't ejected yet which means there's no `babel` key
# in package.json yet
echo '{"presets":["react-app"]}' > .babelrc

# Test "development" environment
E2E_URL="http://localhost:3001" \
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
Expand Down
7 changes: 5 additions & 2 deletions tasks/local-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function print_help {
echo "OPTIONS:"
echo " --node-version <version> the node version to use while testing [8]"
echo " --git-branch <branch> the git branch to checkout for testing [the current one]"
echo " --test-suite <suite> which test suite to use ('simple', installs', 'kitchensink', 'all') ['all']"
echo " --test-suite <suite> which test suite to use ('simple', installs', 'kitchensink', 'kitchensink-eject', 'all') ['all']"
echo " --interactive gain a bash shell after the test run"
echo " --help print this message and exit"
echo ""
Expand Down Expand Up @@ -49,7 +49,7 @@ while [ "$1" != "" ]; do
shift
done

test_command="./tasks/e2e-simple.sh && ./tasks/e2e-kitchensink.sh && ./tasks/e2e-installs.sh"
test_command="./tasks/e2e-simple.sh && ./tasks/e2e-kitchensink.sh && ./tasks/e2e-kitchensink-eject.sh && ./tasks/e2e-installs.sh"
case ${test_suite} in
"all")
;;
Expand All @@ -59,6 +59,9 @@ case ${test_suite} in
"kitchensink")
test_command="./tasks/e2e-kitchensink.sh"
;;
"kitchensink-eject")
test_command="./tasks/e2e-kitchensink-eject.sh"
;;
"installs")
test_command="./tasks/e2e-installs.sh"
;;
Expand Down

0 comments on commit 63398bd

Please sign in to comment.