Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
36d68680
Commit
36d68680
authored
8 years ago
by
Wei Zhu
Committed by
Dan Abramov
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Add test for special scripts versions (#681)
parent
36afd8ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tasks/e2e.sh
+41
-1
tasks/e2e.sh
with
41 additions
and
1 deletion
+41
-1
tasks/e2e.sh
+
41
-
1
View file @
36d68680
...
@@ -36,6 +36,10 @@ function handle_exit {
...
@@ -36,6 +36,10 @@ function handle_exit {
exit
exit
}
}
function
create_react_app
{
node
"
$temp_cli_path
"
/node_modules/create-react-app/index.js
$*
}
# Exit the script with a helpful error message when any error is encountered
# Exit the script with a helpful error message when any error is encountered
trap
'set +x; handle_error $LINENO $BASH_COMMAND'
ERR
trap
'set +x; handle_error $LINENO $BASH_COMMAND'
ERR
...
@@ -124,7 +128,7 @@ npm install $cli_path
...
@@ -124,7 +128,7 @@ npm install $cli_path
# Install the app in a temporary location
# Install the app in a temporary location
temp_app_path
=
`
mktemp
-d
2>/dev/null
||
mktemp
-d
-t
'temp_app_path'
`
temp_app_path
=
`
mktemp
-d
2>/dev/null
||
mktemp
-d
-t
'temp_app_path'
`
cd
$temp_app_path
cd
$temp_app_path
node
"
$temp_cli_path
"
/node_modules/
create
-
react
-
app
/index.js
--scripts-version
=
$scripts_path
test-app
create
_
react
_
app
--scripts-version
=
$scripts_path
test-app
# ******************************************************************************
# ******************************************************************************
# Now that we used create-react-app to create an app depending on react-scripts,
# Now that we used create-react-app to create an app depending on react-scripts,
...
@@ -178,5 +182,41 @@ npm test -- --watch=no
...
@@ -178,5 +182,41 @@ npm test -- --watch=no
# Test the server
# Test the server
npm start
--
--smoke-test
npm start
--
--smoke-test
# ******************************************************************************
# Test --scripts-version is a version number
# ******************************************************************************
cd
$temp_app_path
create_react_app
--scripts-version
=
0.4.0 test-app-version-number
cd
test-app-version-number
# Check corresponding scripts version is installed.
test
-e
node_modules/react-scripts
grep
'"version": "0.4.0"'
node_modules/react-scripts/package.json
# ******************************************************************************
# Test --scripts-version is a tarball url
# ******************************************************************************
cd
$temp_app_path
create_react_app
--scripts-version
=
https://registry.npmjs.org/react-scripts/-/react-scripts-0.4.0.tgz test-app-tarball-url
cd
test-app-tarball-url
# Check corresponding scripts version is installed.
test
-e
node_modules/react-scripts
grep
'"version": "0.4.0"'
node_modules/react-scripts/package.json
# ******************************************************************************
# Test --scripts-version is a custom fork of react-scripts
# ******************************************************************************
cd
$temp_app_path
create_react_app
--scripts-version
=
react-scripts-fork test-app-fork
cd
test-app-fork
# Check corresponding scripts version is installed.
test
-e
node_modules/react-scripts-fork
# Cleanup
# Cleanup
cleanup
cleanup
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment