Skip to content

Instantly share code, notes, and snippets.

@aj0strow
Created September 21, 2015 18:10
Show Gist options
  • Save aj0strow/eab6bf7c5116636f3af3 to your computer and use it in GitHub Desktop.
Save aj0strow/eab6bf7c5116636f3af3 to your computer and use it in GitHub Desktop.
Webpack testing with mocha in the browser
open http://localhost:8080/bundle
webpack-dev-server --config webpack.test.js --hot
// Require local module tests
let appRoot = './src'
let recurisve = true
let pattern = /-test/
let ctx = require.context(appRoot, recursive, pattern)
ctx.keys().forEach(ctx)
let config = require('./webpack.dev.js')
// Use the mocha loader
config.entry = 'mocha!./test-index.js'
module.exports = config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment