Structuring webpack config for use with karma testing -
i create test suite run karma against app using webpack build itself. have 2 entrypoints, app , vendors. these set through my webpack.config.js file here. resulting bundle.js should contain both of these entrypoints in generated file. karma (mocha) tests residing in test/spec/*_spec.js pointing specific components, via require statements like:
var app = require('../src/scripts/app')
they utilize react/jsx seems causing problems during test run jsx errors:
module parse failed: /users/dmarr/src/status/test/spec/app_spec.js line 10: unexpected token < may need appropriate loader handle file type.
i'd keep test runs quick possible fast build times testing webpack-dev-server during development minimizing babel transforms needed.
what need in karma.conf.js builds working? here karma.conf.js file i'm playing around with.
note, have working without breaking out vendor bundle here: https://github.com/bitwise/status
thanks help, dave
in similar setup, disabling commonschunkplugin (for testing only) worked me. give shot!
Comments
Post a Comment