mocha-loader
Allows Mocha tests to be loaded and run via webpack.
Getting Started
To begin, you'll need to install mocha-loader
and mocha
:
npm install --save-dev mocha-loader mocha
Then add the plugin to your webpack
config. For example:
file.js
;
webpack.config.js
moduleexports = entry: './entry.js' output: path: __dirname filename: 'bundle.js' module: rules: test: /test\.js$/ use: 'mocha-loader' exclude: /node_modules/ ;
And run webpack
via your preferred method.
Alternative usage (without configuration):
;
No options for loader.
Examples
Basic
file.js
moduleexports = true;
test.js
;
Contributing
Please take a moment to read our contributing guidelines if you haven't yet done so.