andyhaskell / webpack-mocha-tutorial

Code from my webpack tutorial at https://medium.com/@AndyHaskell2013/webpack-from-0-to-automated-testing-4634844d5c3c
MIT License
7 stars 5 forks source link

Problem when run npm build test #1

Open babolinGiordano opened 5 years ago

babolinGiordano commented 5 years ago

Hello, like title when I try to run "npm run test" I take this error ` C:\Users\a64u\Documents\code\webpack-mocha-tutorial> npm run test

src@1.0.0 test C:\Users\a64u\Documents\code\webpack-mocha-tutorial TESTBUILD=true webpack && mocha test-dist/main.js && rm -rf test-distt

'TESTBUILD' is not recognized as an internal or external command, operable program or batch file. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! src@1.0.0 test: TESTBUILD=true webpack && mocha test-dist/main.js && rm -rf test-distnpm ERR! Exit status 1 npm ERR! npm ERR! Failed at the src@1.0.0 test script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\a64u\AppData\Roaming\npm-cache_logs\2019-01-29T16_31_53_727Z-debug.log`

I don't understand why? I sue windows 10.

Thank GB

noysealyzer commented 5 years ago

..I've tried the Code of 'Commit-5' (unzipped it on Desktop and did 'yarn install' and 'yarn buld').. ..no Problem so far: code runs on 'localhost' saying: Nearest store is Whole Foods Fresh Pond.. ..but there's also a webpack warning (in the 'yarn buld'), which I'm pasting here:

WARNING in configuration The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment. You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/

..in the 'follow-up'-Commit-'branches' webpack is always refusing to recognize TESTBUILD ?!?.. ..even if you use: mode: 'development ' - as suggested in the link above, this does'nt change!..

..any idea how to set up 'webpack.config' to solve this?