You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mocha test runner with integrated webpack precompiler
mocha-webpack is basically a wrapper around the following command...
$ webpack test.js output.js && mocha output.js
... but in a much more powerful & optimized way.
mocha-webpack ...
precompiles your test files automatically with webpack before executing tests
handles source-maps automatically for you
does not write any files to disk
understands globs & all other stuff as test entries like mocha
Benefits over plain mocha
has nearly the same CLI as mocha
you don't rely on hacky solutions to mock all benefits from webpack, like path resolution
mocha-webpack provides a much better watch mode than mocha
Watch mode (--watch)
Unlike mocha, mocha-webpack analyzes your dependency graph and run only those test files that were affected by this file change.
You'll get continuous feedback whenever you make changes as all tests that are related in any way to this change will be tested again. Isn't that awesome?
If any build errors happens, they will be shown like below