Skip to content

Commit 1e9afb9

Browse files
committed
Merge pull request react-bootstrap#871 from AlexKVal/coverage
Fix coverage reporting only for src
2 parents 5e2d0c5 + 91a8ce8 commit 1e9afb9

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

webpack/test-coverage.config.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
11
import _ from 'lodash';
2+
import path from 'path';
23
import { jsLoader } from './base.config';
34
import testConfig from './test.config';
45

6+
const paths = {
7+
SRC: path.resolve('src'),
8+
TEST: path.resolve('test'),
9+
TOOLS: path.resolve('tools') // for tools/public-components.js
10+
};
11+
512
export default _.extend({}, testConfig, {
613
module: {
714
loaders: [
8-
{ test: /\.js/, loader: `${jsLoader}!isparta`, exclude: /node_modules|test[\/\\]/ },
9-
{ test: /\.js/, loader: jsLoader, include: /test[\/\\]/ }
15+
{
16+
test: /\.js/,
17+
include: [paths.SRC, paths.TEST, paths.TOOLS],
18+
loader: jsLoader,
19+
exclude: /node_modules/
20+
}
21+
],
22+
preLoaders: [
23+
{
24+
test: /\.js/,
25+
loader: 'isparta',
26+
include: paths.SRC,
27+
exclude: /node_modules/
28+
}
1029
]
1130
}
1231
});

0 commit comments

Comments
 (0)