fix collecting coverage for jest tests

This commit is contained in:
Sebastian Sdorra
2019-10-14 11:06:23 +02:00
parent b79249c20b
commit 7073a4334d
10 changed files with 1899 additions and 62 deletions

View File

@@ -0,0 +1,15 @@
const path = require("path");
const fs = require("fs");
function findName(directory) {
const packageJSON = JSON.parse(fs.readFileSync(path.join(directory, "package.json"), {encoding: "UTF-8"}));
let name = packageJSON.name;
const orgaIndex = name.indexOf("/");
if (orgaIndex > 0) {
return name.substring(orgaIndex + 1);
}
return name;
}
module.exports = findName;