Closed mvestergaard closed 9 years ago
On another note. Love the project... I'm a big fan of NCrunch for .NET. This type of tool is a fantastic productivity booster.
Thanks you! The issue is fixed.
Please note that you need to change devtool
option in wallaby webpack config to get correct error stack mappings. Wallaby supported devtool
option values are: source-map
, hidden-source-map
, cheap-module-source-map
.
Also, using babel compiler or preprocessor will be more performant in your case. I have updated the documentation for wallaby-webpack, you may see how to configure wallaby for the best performance.
For your specific case the most performant configuration would look like:
wallaby.config.js:
var wallabyWebpack = require('wallaby-webpack');
var webpackConfig = require('./build/config/make-webpack-config')();
var babel = require('babel');
module.exports = function (wallaby) {
var webpackPostprocessor = wallabyWebpack(webpackConfig);
// removing babel-loader, we will use babel compiler instead, it's more performant
webpackConfig.module.loaders = webpackConfig.module.loaders.filter(function(l){
return l.loader !== 'babel-loader';
});
// removing devtool (if you don't have more loaders that transform your code)
delete webpackConfig.devtool;
// if you prefer to use babel loader over babel compiler,
// don't remove it from loaders, assign the webpackConfig.devtool value to:
// 'source-map or 'hidden-source-map' or 'cheap-module-source-map'
// and remove the compilers section below.
var wallabyPostprocessor = wallabyWebpack(webpackConfig);
return {
files: [
{ pattern: 'build/config/phantomjs-shim.js', instrument: false },
{ pattern: 'src/client/**/*.jsx', load: false }
],
tests: [
{ pattern: 'src/tests/client/unit/**/*.jsx', load: false }
],
compilers: {
'src/**/*.js*': wallaby.compilers.babel({ babel: babel /* , stage: 0 */ }),
}
postprocessor: webpackPostprocessor,
bootstrap: function () {
window.__moduleBundler.loadTests();
}
};
};
I created this simple scenario
hello.jsx:
hello.test.jsx:
wallaby.config.js:
Instrumented webpack bundle (hello.jsx.8.wbp.js)
And with instrumentation disabled:
\"Hello\"
with instrumentation\"Hello \"
without.The test fails with:
AssertionError: expected 'Hellofoo' to deeply equal 'Hello foo'
If i change
{ pattern: 'src/client/**/*.jsx', load: false }
in wallaby.config toinstrument: false
it works, but of course I get no wallaby UI.I hope it makes sense :)