Created
September 21, 2015 18:10
-
-
Save aj0strow/eab6bf7c5116636f3af3 to your computer and use it in GitHub Desktop.
Webpack testing with mocha in the browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open http://localhost:8080/bundle | |
webpack-dev-server --config webpack.test.js --hot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Require local module tests | |
let appRoot = './src' | |
let recurisve = true | |
let pattern = /-test/ | |
let ctx = require.context(appRoot, recursive, pattern) | |
ctx.keys().forEach(ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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