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
9a70038b
Commit
9a70038b
authored
8 years ago
by
Dan Abramov
Committed by
GitHub
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Preserve scripts/test.js after ejecting (#715)
Fixes
#702
parent
f54c9d8f
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/react-scripts/scripts/eject.js
+1
-1
packages/react-scripts/scripts/eject.js
packages/react-scripts/scripts/test.js
+6
-1
packages/react-scripts/scripts/test.js
with
7 additions
and
2 deletions
+7
-2
packages/react-scripts/scripts/eject.js
+
1
-
1
View file @
9a70038b
...
...
@@ -39,6 +39,7 @@ prompt(
path
.
join
(
'
config
'
,
'
jest
'
,
'
FileStub.js
'
),
path
.
join
(
'
scripts
'
,
'
build.js
'
),
path
.
join
(
'
scripts
'
,
'
start.js
'
),
path
.
join
(
'
scripts
'
,
'
test.js
'
),
path
.
join
(
'
scripts
'
,
'
utils
'
,
'
checkRequiredFiles.js
'
),
path
.
join
(
'
scripts
'
,
'
utils
'
,
'
chrome.applescript
'
),
path
.
join
(
'
scripts
'
,
'
utils
'
,
'
getClientEnvironment.js
'
),
...
...
@@ -98,7 +99,6 @@ prompt(
delete
appPackage
.
scripts
[
'
eject
'
];
Object
.
keys
(
appPackage
.
scripts
).
forEach
(
function
(
key
)
{
appPackage
.
scripts
[
key
]
=
appPackage
.
scripts
[
key
]
.
replace
(
/react-scripts test/g
,
'
jest --watch
'
)
.
replace
(
/react-scripts
(\w
+
)
/g
,
'
node scripts/$1.js
'
);
});
...
...
This diff is collapsed.
Click to expand it.
packages/react-scripts/scripts/test.js
+
6
-
1
View file @
9a70038b
// @remove-on-eject-begin
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
...
...
@@ -6,6 +7,7 @@
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
// @remove-on-eject-end
process
.
env
.
NODE_ENV
=
'
test
'
;
process
.
env
.
PUBLIC_URL
=
''
;
...
...
@@ -16,7 +18,6 @@ process.env.PUBLIC_URL = '';
// https://github.com/motdotla/dotenv
require
(
'
dotenv
'
).
config
({
silent
:
true
});
const
createJestConfig
=
require
(
'
./utils/createJestConfig
'
);
const
jest
=
require
(
'
jest
'
);
const
path
=
require
(
'
path
'
);
const
paths
=
require
(
'
../config/paths
'
);
...
...
@@ -28,10 +29,14 @@ if (!process.env.CI) {
argv
.
push
(
'
--watch
'
);
}
// @remove-on-eject-begin
// This is not necessary after eject because we embed config into package.json.
const
createJestConfig
=
require
(
'
./utils/createJestConfig
'
);
argv
.
push
(
'
--config
'
,
JSON
.
stringify
(
createJestConfig
(
relativePath
=>
path
.
resolve
(
__dirname
,
'
..
'
,
relativePath
),
path
.
resolve
(
paths
.
appSrc
,
'
..
'
),
false
)));
// @remove-on-eject-end
jest
.
run
(
argv
);
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