我正在使用mocha-webpack来运行我的react项目的测试。我之所以不只是在调用mocha时指定babel,是因为我有引用svg文件的jsx,当我这样做的时候,它就会崩溃。mocha- have运行得很好。但我不能让它与伊斯坦布尔一起工作。我已经用bable-bable loader替换了babel-loader,编译并执行测试,但它不会输出任何地方的覆盖文件夹。
另外,巴别塔-伊斯坦布尔似乎想使用karma,但我不使用karma,因为我是在浏览器中测试的。
加载器看起来像这样:
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-istanbul'
},package.config说
"test": "mocha-webpack --webpack-config ./app/webpack.config-testing.js",发布于 2016-10-05 07:47:09
我有点事要做,和纽约市(伊斯坦布尔指挥线)。我删除了一些文件的名称,并更改了一些数据,使其成为通用的。我在这里发现了如何做到这一点:https://github.com/zinserjan/mocha-webpack/issues/19
nyc mocha-webpack <testfile> "$@" --colors --webpack-config webpack.config.js --require scripts/mocha-jsdom-setup.js
<Some React Component />
✓ should render the props1
✓ should render the props2
✓ should render the props 3
3 passing (29ms)
---------------------------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
---------------------------------|----------|----------|----------|----------|----------------|
All files | 70.14 | 12.43 | 91.76 | 71.37 | |
<something> | 100 | 50 | 100 | 100 | |
<something> | 100 | 50 | 100 | 100 | |
<something> | 100 | 50 | 100 | 100 | |
<something>| 69.57 | 10.53 | 91.75 | 70.82 | |
<something> | 69.57 | 10.53 | 91.75 | 70.82 |84 |
<something> | 100 | 100 | 100 | 100 | |
<something> | 100 | 100 | 100 | 100 | |
---------------------------------|----------|----------|----------|----------|----------------|https://stackoverflow.com/questions/38353856
复制相似问题