1
使用因缘+巴贝尔+的WebPack运行ES6单元测试。我使用webpack软件包来定位和传输ES6。它所有的工作,但每当有任何测试文件,我得到任何迹象表明那里产生错误信息的错误,像跟踪误差使用因缘+巴别+的WebPack与束
Uncaught TypeError: Cannot read property 'querySelector' of null
at /pth/to/test.bundle.js:13256
这总是/pth/to/test.bundle.js:xxxx
。任何想法如何让它显示更有用的消息?
这里是我的配置
module.exports = function(config) {
config.set({
browsers: ["Chrome"],
files: [
{
pattern: "test.bundle.js",
watched: false
}],
frameworks: ["jasmine-jquery", "jasmine-ajax", "jasmine"],
preprocessors: {,
"test.bundle.js": ["webpack"]
},
reporters: ["dots"],
singleRun: false,
webpack: {
module: {
loaders: [{
test: /\.js/,
exclude: /node_modules/,
loader: "babel-loader?cacheDirectory&optional[]=runtime"
}]
},
watch: true
},
webpackServer: {
noInfo: true
}
});
};
而且我test.bundle.js
var context = require.context("./src", true, /.+(-helpers|\.test)\.js$/);
context.keys().forEach(context);
对不起,对于最近的答复 - 辉煌,工程,谢谢! – gotofritz