@code-pushup/coverage-plugin 0.27.1 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin.js +1 -1
- package/index.js +13 -7
- package/package.json +1 -1
- package/src/lib/nx/coverage-paths.d.ts +1 -1
package/bin.js
CHANGED
|
@@ -716,7 +716,7 @@ function pluginWorkDir(slug) {
|
|
|
716
716
|
|
|
717
717
|
// packages/utils/src/lib/reports/utils.ts
|
|
718
718
|
function calcDuration(start, stop) {
|
|
719
|
-
return Math.
|
|
719
|
+
return Math.round((stop ?? performance.now()) - start);
|
|
720
720
|
}
|
|
721
721
|
|
|
722
722
|
// packages/utils/src/lib/execute-process.ts
|
package/index.js
CHANGED
|
@@ -721,7 +721,7 @@ import chalk4 from "chalk";
|
|
|
721
721
|
|
|
722
722
|
// packages/plugin-coverage/package.json
|
|
723
723
|
var name = "@code-pushup/coverage-plugin";
|
|
724
|
-
var version = "0.
|
|
724
|
+
var version = "0.28.0";
|
|
725
725
|
|
|
726
726
|
// packages/plugin-coverage/src/lib/config.ts
|
|
727
727
|
import { z as z15 } from "zod";
|
|
@@ -849,10 +849,12 @@ async function coveragePlugin(config) {
|
|
|
849
849
|
// packages/plugin-coverage/src/lib/nx/coverage-paths.ts
|
|
850
850
|
import chalk6 from "chalk";
|
|
851
851
|
import { join as join4 } from "node:path";
|
|
852
|
-
async function getNxCoveragePaths(targets = ["test"]) {
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
852
|
+
async function getNxCoveragePaths(targets = ["test"], verbose) {
|
|
853
|
+
if (verbose) {
|
|
854
|
+
ui().logger.info(
|
|
855
|
+
chalk6.bold("\u{1F4A1} Gathering coverage from the following nx projects:")
|
|
856
|
+
);
|
|
857
|
+
}
|
|
856
858
|
const { createProjectGraphAsync } = await import("@nx/devkit");
|
|
857
859
|
const { nodes } = await createProjectGraphAsync({ exitOnError: false });
|
|
858
860
|
const coverageResults = targets.map((target) => {
|
|
@@ -863,14 +865,18 @@ async function getNxCoveragePaths(targets = ["test"]) {
|
|
|
863
865
|
const targetConfig = data.targets?.[target];
|
|
864
866
|
const coveragePath = getCoveragePathForTarget(target, targetConfig, name2);
|
|
865
867
|
const rootToReportsDir = join4(data.root, coveragePath);
|
|
866
|
-
|
|
868
|
+
if (verbose) {
|
|
869
|
+
ui().logger.info(`- ${name2}: ${target}`);
|
|
870
|
+
}
|
|
867
871
|
return {
|
|
868
872
|
pathToProject: data.root,
|
|
869
873
|
resultsPath: join4(rootToReportsDir, "lcov.info")
|
|
870
874
|
};
|
|
871
875
|
});
|
|
872
876
|
});
|
|
873
|
-
|
|
877
|
+
if (verbose) {
|
|
878
|
+
ui().logger.info("\n");
|
|
879
|
+
}
|
|
874
880
|
return coverageResults.flat();
|
|
875
881
|
}
|
|
876
882
|
function hasNxTarget(project, target) {
|
package/package.json
CHANGED
|
@@ -3,4 +3,4 @@ import { CoverageResult } from '../config';
|
|
|
3
3
|
* @param targets nx targets to be used for measuring coverage, test by default
|
|
4
4
|
* @returns An array of coverage result information for the coverage plugin.
|
|
5
5
|
*/
|
|
6
|
-
export declare function getNxCoveragePaths(targets?: string[]): Promise<CoverageResult[]>;
|
|
6
|
+
export declare function getNxCoveragePaths(targets?: string[], verbose?: boolean): Promise<CoverageResult[]>;
|