diff --git a/.c8rc.json b/.c8rc.json index 7e5b1a862..4a6fd3b0e 100644 --- a/.c8rc.json +++ b/.c8rc.json @@ -1,8 +1,9 @@ { - "statements": 99.9, - "branches": 99.7, + "checkCoverage": true, + "statements": 99.89, + "branches": 98.72, "functions": 100, - "lines": 99.9, + "lines": 99.89, "exclude": [ "bin", "configs", diff --git a/src/cache/helpers.mjs b/src/cache/helpers.mjs index 7bfe83da2..55c1e9c92 100644 --- a/src/cache/helpers.mjs +++ b/src/cache/helpers.mjs @@ -1,7 +1,6 @@ // @ts-check import { createHash } from "node:crypto"; import { readFileSync } from "node:fs"; -import { readFile } from "node:fs/promises"; import { extname } from "node:path"; import memoize from "lodash/memoize.js"; // @ts-expect-error ts(2307) - the ts compiler is not privy to the existence of #imports in package.json @@ -15,27 +14,6 @@ function hash(pString) { return createHash("sha1").update(pString).digest("base64"); } -/** - * @param {string} pFileName - * @returns {Promise} - */ -async function _getFileHash(pFileName) { - try { - return hash(await readFile(pFileName, "utf8")); - } catch (pError) { - return "file not found"; - } -} - -export const getFileHash = memoize(_getFileHash); - -export async function addCheckSumToChange(pChange) { - return { - ...pChange, - checksum: await getFileHash(pChange.name), - }; -} - /** * @param {string} pFileName * @returns {string} diff --git a/test/cli/listeners/performance-log-listener/format-helpers.spec.mjs b/test/cli/listeners/performance-log-listener/format-helpers.spec.mjs index 6b3619db9..71daaa323 100644 --- a/test/cli/listeners/performance-log-listener/format-helpers.spec.mjs +++ b/test/cli/listeners/performance-log-listener/format-helpers.spec.mjs @@ -6,6 +6,7 @@ import { formatMemory, formatPerfLine, } from "#cli/listeners/performance-log/format-helpers.mjs"; +import { DEBUG } from "#utl/bus.mjs"; /* * as the formatHelpers use the Intl API, it's necessary to set the locale @@ -80,7 +81,7 @@ describe("[U] cli/listeners/performance-log/format-helpers - formatMemory", () = }); it("converts to kB, left pads & adds the unit at the end (not a number)", () => { - equal(formatMemory("not a number"), " NaNkB "); + equal(formatMemory("not a number", DEBUG), " NaNkB "); }); });