Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit Testing: Crashing in Mocha? #28

Open
markpassando opened this issue Nov 23, 2016 · 1 comment
Open

Unit Testing: Crashing in Mocha? #28

markpassando opened this issue Nov 23, 2016 · 1 comment

Comments

@markpassando
Copy link

markpassando commented Nov 23, 2016

I've got this to work great with the browser but I am having problems with Unit Testing.

I am new to unit testing and Mocha. I may be missing something related to that but I am testing React with Redux containers with webpack and Mocha.

The import of font-awesome-webpack will throw me this error.
import 'font-awesome-webpack';
I have tested a few components and containers but any of them using that import line will throw me this error. If I comment the import line out, the code will pass perfectly. The error is below.

Error: Cannot find module 'style!css!less!./font-awesome-styles!./font-awesome.config.js' at Function.Module._resolveFilename (module.js:325:15) at Function.Module._load (module.js:276:25) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object.<anonymous> (c:\react\weather\node_modules\font-awesome-webpack\index.js:1:1) at Module._compile (module.js:409:26) at Module._extensions..js (module.js:416:10) at Object.require.extensions.(anonymous function) [as .js] (c:\react\weather\node_modules\babel-core\node_modules\babel-register\lib\node.js:152:7) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object.<anonymous> (c:/react/weather/src/components/app.js:6:1) at Module._compile (module.js:409:26) at loader (c:\react\weather\node_modules\babel-core\node_modules\babel-register\lib\node.js:144:5) at Object.require.extensions.(anonymous function) [as .js] (c:\react\weather\node_modules\babel-core\node_modules\babel-register\lib\node.js:154:7) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object.<anonymous> (c:/react/weather/test/components/app_test.js:2:1) at Module._compile (module.js:409:26) at loader (c:\react\weather\node_modules\babel-core\node_modules\babel-register\lib\node.js:144:5) at Object.require.extensions.(anonymous function) [as .js] (c:\react\weather\node_modules\babel-core\node_modules\babel-register\lib\node.js:154:7) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at c:\react\weather\node_modules\mocha\lib\mocha.js:222:27 at Array.forEach (native) at Mocha.loadFiles (c:\react\weather\node_modules\mocha\lib\mocha.js:219:14) at Mocha.run (c:\react\weather\node_modules\mocha\lib\mocha.js:487:10) at loadAndRun (c:\react\weather\node_modules\mocha\bin\_mocha:415:22) at rerun (c:\react\weather\node_modules\mocha\bin\_mocha:443:5) at c:\react\weather\node_modules\mocha\bin\_mocha:451:7 at StatWatcher.<anonymous> (c:\react\weather\node_modules\mocha\lib\utils.js:195:9) at emitTwo (events.js:87:13) at StatWatcher.emit (events.js:172:7) at StatWatcher._handle.onchange (fs.js:1290:10)

I appreciate any help.
Thanks!

@wolfadex
Copy link
Collaborator

Are you using webpack 2? If so this should be resolved by #23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants