@@ -228,6 +228,25 @@ function verify_env_url {
228228  mv package.json.orig package.json
229229}
230230
231+ function  verify_module_scope  {
232+   #  Create stub json file
233+   echo  " {}" >>  sample.json
234+ 
235+   #  Save App.js, we're going to modify it
236+   cp src/App.js src/App.js.bak
237+ 
238+   #  Add an out of scope import
239+   echo  " import sampleJson from '../sample'" |  cat - src/App.js >  src/App.js.temp &&  mv src/App.js.temp src/App.js
240+ 
241+   #  Make sure the build fails
242+   npm run build;  test  $?  -eq 1 ||  exit  1
243+   #  TODO: check for error message
244+ 
245+   #  Restore App.js
246+   rm src/App.js
247+   mv src/App.js.bak src/App.js
248+ }
249+ 
231250#  Enter the app directory
232251cd  test-app
233252
@@ -251,6 +270,9 @@ npm start -- --smoke-test
251270#  Test environment handling
252271verify_env_url
253272
273+ #  Test reliance on webpack internals
274+ verify_module_scope
275+ 
254276#  ******************************************************************************
255277#  Finally, let's check that everything still works after ejecting.
256278#  ******************************************************************************
@@ -287,5 +309,8 @@ npm start -- --smoke-test
287309#  Test environment handling
288310verify_env_url
289311
312+ #  Test reliance on webpack internals
313+ verify_module_scope
314+ 
290315#  Cleanup
291316cleanup
0 commit comments