mocha loader module for webpack
JavaScript
Clone or download
shellscape and d3viant0ne refactor(defaults): update to latest webpack-defaults (#73)
BREAKING CHANGE: Enforces `engines` of `"node": ">=6.9.0 < 7.0.0 || >= 8.9.0`
Latest commit e9bf238 Apr 30, 2018
Permalink
Failed to load latest commit information.
.circleci refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
.github refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
example refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
lib refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
test refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
.babelrc refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
.editorconfig refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
.eslintignore refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
.eslintrc.js refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
.gitattributes refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
.gitignore refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
.prettierrc refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
CHANGELOG.md chore(release): 1.1.3 Jan 24, 2018
LICENSE docs(LICENSE): add JSF License Feb 20, 2017
README.md refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
codecov.yml refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
commitlint.config.js refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
package-lock.json refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018
package.json refactor(defaults): update to latest webpack-defaults (#73) Apr 30, 2018

README.md

npm node deps tests chat

mocha-loader

mocha loader module for webpack

Requirements

This module requires a minimum of Node v6.9.0 and Webpack v4.0.0.

Getting Started

To begin, you'll need to install mocha-loader:

$ npm install mocha-loader --save-dev

Then add the loader to your webpack config. For example:

// webpack.config.js
module.exports = {
  entry: './entry.js',
  output: {
    path: __dirname,
    filename: 'bundle.js'
  },
  module: {
    rules: [{
      test: /test\.js$/,
      use: 'mocha-loader',
      exclude: /node_modules/,
    }]
  }
}

Then import the target file somewhere in your app:

// src/entry.js
import test from './test'

And run webpack via your preferred method.

Examples

You can also use the loader via:

CLI

webpack --module-bind 'mocha-loader!./test'

Require

import test from 'mocha-loader!./test'

Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.

CONTRIBUTING

License

MIT