Allows Mocha tests to be loaded and run via webpack
npm install --save-dev mocha-loader
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/,
}]
}
}
import test from './test'
webpack --module-bind 'mocha-loader!./test'
import test from './test'
import test from 'mocha-loader!./test'
Juho Vepsäläinen | Joshua Wiens | Kees Kluskens | Sean Larkin |