Skip to content

Commit

Permalink
include changed files from git diff
Browse files Browse the repository at this point in the history
  • Loading branch information
coopernetes committed Oct 21, 2023
1 parent 62dad68 commit 03d57c5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
6 changes: 0 additions & 6 deletions .nycrc.json

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,4 @@ This project is distributed under the Apache-2.0 license. See <a href="./LICENSE

If you have a query or require support with this project, [raise an issue](https://github.com/finos/git-proxy/issues). Otherwise, reach out to [[email protected]](mailto:[email protected]).


21 changes: 21 additions & 0 deletions nyc.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';

const { exec } = require('child_process');

console.log('Generating coverage report for changed files...');
const files = [];
exec('git diff --name-only HEAD~1', (err, stdout, stderr) => {
if (err) {
console.error(err + stderr);
return;
}
files.push(...stdout.split('\n'));
});

module.exports = {
include: files,
branches: 80,
lines: 80,
functions: 80,
statements: 80,
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"server-test": "mocha --exit",
"test": "mocha --exit",
"test-coverage": "nyc npm run test",
"test-coverage-ci": "nyc --reporter=lcovonly --reporter=text-summary --check-coverage npm run test",
"test-coverage-ci": "nyc --reporter=lcovonly --reporter=text --check-coverage npm run test",
"prepare": "node ./scripts/prepare.js",
"lint": "eslint --fix . --ext .js,.jsx"
},
Expand Down

0 comments on commit 03d57c5

Please sign in to comment.