Skip to content

Commit

Permalink
Add code coverage output generation to npm test (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
dopry authored and Benaiah committed Sep 20, 2017
1 parent 1def72e commit 1f06885
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ yarn-error.log
.vscode/
manifest.yml
.imdone/

/coverage/
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "dist/cms.js",
"scripts": {
"start": "webpack-dev-server -d --config webpack.dev.js",
"test": "jest",
"test": "jest --coverage",
"test:watch": "jest --watch",
"build": "cross-env NODE_ENV=production webpack --config webpack.prod.js --display-error-details",
"build:scripts": "cross-env NODE_ENV=production webpack --config webpack.cli.js",
Expand Down Expand Up @@ -39,7 +39,11 @@
"moduleNameMapper": {
"^.+\\.(png|eot|woff|woff2|ttf|svg|gif)$": "<rootDir>/__mocks__/fileLoaderMock.js",
"^.+\\.s?css$": "<rootDir>/__mocks__/styleLoaderMock.js"
}
},
"mapCoverage": true,
"coverageReporters": ["lcov"],
"collectCoverageFrom": [ "src/**/*.js" ],
"coveragePathIgnorePatterns": [ "/__tests__/" ]
},
"keywords": [
"netlify",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,15 @@ export default function remarkPaddedLinks() {
* nesting. If `end` is truthy, get the last node, otherwise first.
*/
function getEdgeTextChild(node, end) {
const findFn = end ? findLast : find;
/**
* This was changed from a ternary to a long form if due to issues with istanbul's instrumentation and babel's code
* generation.
* TODO: watch https://github.com/istanbuljs/babel-plugin-istanbul/issues/95
* when it is resolved then revert to ```const findFn = end ? findLast : find;```
*/
let findFn;
if (end) { findFn = findLast }
else { findFn = find };

let edgeChildWithValue;
setEdgeChildWithValue(node);
Expand Down

0 comments on commit 1f06885

Please sign in to comment.