Skip to content

Commit 1f40f05

Browse files
committed
Detect yarn usage from execpath env variable as signal to use yarn
as the package manager. Otherwise it will use npm.
1 parent 64ff23d commit 1f40f05

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

tasks/e2e-installs.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,11 @@ cd "$temp_app_path"
112112
npx create-react-app test-app-dist-tag --scripts-version=@latest
113113
cd test-app-dist-tag
114114

115-
# Check corresponding scripts version is installed and no TypeScript is present.
115+
# Check corresponding scripts version is installed and no TypeScript or yarn is present by default
116116
exists node_modules/react-scripts
117117
! exists node_modules/typescript
118118
! exists src/index.tsx
119+
! exists yarn.lock
119120
exists src/index.js
120121
checkDependencies
121122

@@ -133,16 +134,16 @@ grep '"version": "1.0.17"' node_modules/react-scripts/package.json
133134
checkDependencies
134135

135136
# ******************************************************************************
136-
# Test --use-npm flag
137+
# Test --use-yarn flag
137138
# ******************************************************************************
138139

139140
cd "$temp_app_path"
140-
npx create-react-app test-use-npm-flag --use-npm --scripts-version=1.0.17
141-
cd test-use-npm-flag
141+
npx create-react-app test-use-yarn-flag --use-yarn --scripts-version=1.0.17
142+
cd test-use-yarn-flag
142143

143144
# Check corresponding scripts version is installed.
144145
exists node_modules/react-scripts
145-
[ ! -e "yarn.lock" ] && echo "yarn.lock correctly does not exist"
146+
exists yarn.lock
146147
grep '"version": "1.0.17"' node_modules/react-scripts/package.json
147148
checkDependencies
148149

@@ -277,7 +278,7 @@ npm start -- --smoke-test
277278
# Test when PnP is enabled
278279
# ******************************************************************************
279280
cd "$temp_app_path"
280-
npx create-react-app test-app-pnp --use-pnp
281+
npx create-react-app test-app-pnp --use-yarn --use-pnp
281282
cd test-app-pnp
282283
! exists node_modules
283284
exists .pnp.js

tasks/e2e-kitchensink-eject.sh

-6
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ cd "$temp_app_path/test-kitchensink"
110110
# In kitchensink, we want to test all transforms
111111
export BROWSERSLIST='ie 9'
112112

113-
# Link to test module
114-
npm link "$temp_module_path/node_modules/test-integrity"
115-
116113
# ******************************************************************************
117114
# Finally, let's check that everything still works after ejecting.
118115
# ******************************************************************************
@@ -124,9 +121,6 @@ echo yes | npm run eject
124121
rm yarn.lock
125122
yarn add @babel/plugin-transform-react-jsx-source @babel/plugin-syntax-jsx @babel/plugin-transform-react-jsx @babel/plugin-transform-react-jsx-self
126123

127-
# Link to test module
128-
npm link "$temp_module_path/node_modules/test-integrity"
129-
130124
# Test the build
131125
REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \
132126
NODE_PATH=src \

0 commit comments

Comments
 (0)