• Joe Haddad's avatar
    Polish webpack message output (#5174) · 7b1a32be
    Joe Haddad authored
    * Only install react-scripts in CI mode
    
    * Link locally
    
    * Re-enable all output tests
    
    * :lipstick: Polish webpack output
    
    * Test sass support message
    
    * Add more tests, but disabled
    
    * Format missing default export error
    
    * Format aliased import
    
    * Why was node-sass required? Odd
    
    * Format webpack rejection error
    
    * Re-enable unknown package test
    
    * Format file not found error and catch module scope plugin error
    
    * Re-disable case sensitive paths
    
    * Intercept and format case sensitive path errors
    
    * Test out of scope message formatting
    
    * Run behavior on macOS
    
    * Run behavior on Node 8 and 10, only Node 8 for macOS
    
    * Add some debugging
    
    * Update matcher
    
    * Only check stderr
    
    * Remove old snapshot
    
    * More debug
    
    * Remove debug
    
    * Add new debug
    
    * Disable test on linux
    
    * Add comment for future
    Unverified
    7b1a32be
index.test.js.snap 3.49 KiB
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`webpack message formatting formats aliased unknown export 1`] = `
Object {
  "stderr": "Creating an optimized production build...
Failed to compile.
./src/App.js
Attempted import error: 'bar' is not exported from './AppUnknownExport' (imported as 'bar2').
  "stdout": "",
exports[`webpack message formatting formats babel syntax error 1`] = `
Object {
  "stderr": "Creating an optimized production build...
Failed to compile.
./src/App.js
Syntax error: Unterminated JSX contents (8:13)
   6 |       <div>
   7 |         <span>
>  8 |       </div>
     |             ^
   9 |     );
  10 |   }
  11 | }
  "stdout": "",
exports[`webpack message formatting formats css syntax error 1`] = `
Object {
  "stderr": "Creating an optimized production build...
Failed to compile.
./src/AppCss.css
Syntax error: Unexpected } (3:2)
  1 | .App {
  2 |   color: red;
> 3 | }}
    |  ^
  4 |
  "stdout": "",
exports[`webpack message formatting formats eslint error 1`] = `
Object {
  "stderr": "Creating an optimized production build...
Failed to compile.
./src/App.js
  Line 4:  'b' is not defined  no-undef
Search for the keywords to learn more about each error.
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
"stdout": "", } `; exports[`webpack message formatting formats eslint warning 1`] = ` Object { "stderr": "", "stdout": "Creating an optimized production build... Compiled with warnings. ./src/App.js Line 3: 'foo' is defined but never used no-unused-vars Search for the keywords to learn more about each warning. To ignore, add // eslint-disable-next-line to the line before. ", } `; exports[`webpack message formatting formats file not found error 1`] = ` Object { "stderr": "Creating an optimized production build... Failed to compile. ./src/App.js Cannot find file './ThisFileSouldNotExist' in './src'. ", "stdout": "", } `; exports[`webpack message formatting formats missing package 1`] = ` Object { "stderr": "Creating an optimized production build... Failed to compile. ./src/App.js Cannot find module: 'unknown-package'. Make sure this package is installed. You can install this package by running: yarn add unknown-package. ", "stdout": "", } `; exports[`webpack message formatting formats no default export 1`] = ` Object { "stderr": "Creating an optimized production build... Failed to compile. ./src/App.js Attempted import error: './ExportNoDefault' does not contain a default export (imported as 'myImport'). ", "stdout": "", } `; exports[`webpack message formatting formats out of scope error 1`] = ` Object { "stderr": "Creating an optimized production build... Failed to compile. ./src/App.js
141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
You attempted to import ../OutOfScopeImport which falls outside of the project src/ directory. Relative imports outside of src/ are not supported. You can either move it inside src/, or add a symlink to it from project's node_modules/. ", "stdout": "", } `; exports[`webpack message formatting formats unknown export 1`] = ` Object { "stderr": "Creating an optimized production build... Failed to compile. ./src/App.js Attempted import error: 'bar' is not exported from './AppUnknownExport'. ", "stdout": "", } `; exports[`webpack message formatting helps when users tries to use sass 1`] = ` Object { "stderr": "Creating an optimized production build... Failed to compile. ./src/AppSass.scss To import Sass files, you first need to install node-sass. Run \`npm install node-sass\` or \`yarn add node-sass\` inside your workspace. ", "stdout": "", } `;