Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
a52b697d
Commit
a52b697d
authored
8 years ago
by
Dan Abramov
Committed by
GitHub
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Enable watch implicitly unless on CI (#533)
Fixes
#532
parent
e48b6171
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
package.json
+1
-1
package.json
scripts/eject.js
+1
-1
scripts/eject.js
scripts/init.js
+1
-1
scripts/init.js
scripts/test.js
+5
-0
scripts/test.js
tasks/e2e.sh
+6
-5
tasks/e2e.sh
with
14 additions
and
8 deletions
+14
-8
package.json
+
1
-
1
View file @
a52b697d
...
...
@@ -15,7 +15,7 @@
"create-react-app"
:
"node global-cli/index.js --scripts-version
\"
$PWD/`npm pack`
\"
"
,
"e2e"
:
"tasks/e2e.sh"
,
"start"
:
"node scripts/start.js --debug-template"
,
"test"
:
"node scripts/test.js --debug-template
--watch
--env=jsdom"
"test"
:
"node scripts/test.js --debug-template --env=jsdom"
},
"files"
:
[
"PATENTS"
,
...
...
This diff is collapsed.
Click to expand it.
scripts/eject.js
+
1
-
1
View file @
a52b697d
...
...
@@ -101,7 +101,7 @@ prompt(
delete
appPackage
.
scripts
[
'
eject
'
];
Object
.
keys
(
appPackage
.
scripts
).
forEach
(
function
(
key
)
{
appPackage
.
scripts
[
key
]
=
appPackage
.
scripts
[
key
]
.
replace
(
/react-scripts test/g
,
'
jest
'
)
.
replace
(
/react-scripts test/g
,
'
jest
--watch
'
)
.
replace
(
/react-scripts
(\w
+
)
/g
,
'
node scripts/$1.js
'
);
});
...
...
This diff is collapsed.
Click to expand it.
scripts/init.js
+
1
-
1
View file @
a52b697d
...
...
@@ -26,7 +26,7 @@ module.exports = function(appPath, appName, verbose, originalDirectory) {
appPackage
.
scripts
=
{
'
start
'
:
'
react-scripts start
'
,
'
build
'
:
'
react-scripts build
'
,
'
test
'
:
'
react-scripts test
--watch
--env=jsdom
'
,
'
test
'
:
'
react-scripts test --env=jsdom
'
,
'
eject
'
:
'
react-scripts eject
'
};
...
...
This diff is collapsed.
Click to expand it.
scripts/test.js
+
5
-
0
View file @
a52b697d
...
...
@@ -22,6 +22,11 @@ if (debugTemplateIndex !== -1) {
argv
.
splice
(
debugTemplateIndex
,
1
);
}
// Watch unless on CI
if
(
!
process
.
env
.
CI
)
{
argv
.
push
(
'
--watch
'
);
}
argv
.
push
(
'
--config
'
,
JSON
.
stringify
(
createJestConfig
(
relativePath
=>
path
.
resolve
(
__dirname
,
'
..
'
,
relativePath
),
path
.
resolve
(
paths
.
appSrc
,
'
..
'
)
...
...
This diff is collapsed.
Click to expand it.
tasks/e2e.sh
+
6
-
5
View file @
a52b697d
...
...
@@ -67,8 +67,8 @@ test -e build/static/css/*.css
test
-e
build/static/media/
*
.svg
test
-e
build/favicon.ico
# Run tests
, overriding watch option to disable it
npm
test
--
--watch
=
no
# Run tests
with CI flag
CI
=
true
npm
test
# Uncomment when snapshot testing is enabled by default:
# test -e template/src/__snapshots__/App.test.js.snap
...
...
@@ -101,8 +101,8 @@ test -e build/static/css/*.css
test
-e
build/static/media/
*
.svg
test
-e
build/favicon.ico
# Run tests
, overriding watch option to disable it
npm
test
--
--watch
=
no
# Run tests
with CI flag
CI
=
true
npm
test
# Uncomment when snapshot testing is enabled by default:
# test -e src/__snapshots__/App.test.js.snap
...
...
@@ -120,7 +120,8 @@ test -e build/static/css/*.css
test
-e
build/static/media/
*
.svg
test
-e
build/favicon.ico
# Run tests, overriding watch option to disable it
# Run tests, overring the watch option to disable it
# TODO: make CI flag respected after ejecting as well
npm
test
--
--watch
=
no
# Uncomment when snapshot testing is enabled by default:
# test -e src/__snapshots__/App.test.js.snap
...
...
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
Menu
Explore
Projects
Groups
Snippets