Socket
Socket
Sign inDemoInstall

mutation-testing-metrics

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mutation-testing-metrics - npm Package Compare versions

Comparing version 2.0.5 to 3.0.0

dist/src/aggregate.d.ts.map

2

dist/src/aggregate.d.ts

@@ -1,2 +0,2 @@

import { MutationTestResult } from 'mutation-testing-report-schema';
import type { MutationTestResult } from 'mutation-testing-report-schema';
/**

@@ -3,0 +3,0 @@ * Aggregates multiple reports together into a single report, grouped by module.

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.aggregateResultsByModule = void 0;
const helpers_1 = require("./helpers");
import { determineCommonBasePath, isNotNullish, normalizeFileNames } from './helpers/index.js';
/**

@@ -11,6 +8,6 @@ * Aggregates multiple reports together into a single report, grouped by module.

*/
function aggregateResultsByModule(resultsByModule) {
export function aggregateResultsByModule(resultsByModule) {
const projectRoots = Object.values(resultsByModule)
.map((report) => report.projectRoot)
.filter(helpers_1.isNotNullish);
.filter(isNotNullish);
const aggregatedResult = {

@@ -20,7 +17,7 @@ files: {},

thresholds: resultsByModule[0]?.thresholds ?? { high: 80, low: 60 },
projectRoot: projectRoots.length ? (0, helpers_1.determineCommonBasePath)(projectRoots) : undefined,
projectRoot: projectRoots.length ? determineCommonBasePath(projectRoots) : undefined,
config: {},
};
return Object.entries(resultsByModule).reduce((acc, [moduleName, report]) => {
Object.entries((0, helpers_1.normalizeFileNames)(report.files)).forEach(([fileName, fileResult]) => {
Object.entries(normalizeFileNames(report.files)).forEach(([fileName, fileResult]) => {
aggregatedResult.files[`${moduleName}/${fileName}`] = {

@@ -40,3 +37,3 @@ ...fileResult,

const aggregatedTestFiles = aggregatedResult.testFiles ?? (aggregatedResult.testFiles = Object.create(null));
Object.entries((0, helpers_1.normalizeFileNames)(report.testFiles)).forEach(([fileName, testFileResult]) => {
Object.entries(normalizeFileNames(report.testFiles)).forEach(([fileName, testFileResult]) => {
aggregatedTestFiles[`${moduleName}/${fileName}`] = {

@@ -51,3 +48,2 @@ ...testFileResult,

}
exports.aggregateResultsByModule = aggregateResultsByModule;
function toUniqueIds(moduleName, localIds) {

@@ -54,0 +50,0 @@ if (localIds) {

@@ -1,3 +0,4 @@

import { FileResult, MutationTestResult } from 'mutation-testing-report-schema/api';
import { FileUnderTestModel, Metrics, MetricsResult, MutationTestMetricsResult, TestFileModel, TestMetrics } from './model';
import type { FileResult, MutationTestResult } from 'mutation-testing-report-schema';
import type { Metrics, MutationTestMetricsResult, TestMetrics } from './model/index.js';
import { FileUnderTestModel, MetricsResult, TestFileModel } from './model/index.js';
/**

@@ -4,0 +5,0 @@ * Calculates the files-under-test metrics inside of a mutation testing report

@@ -1,9 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.countFileMetrics = exports.countTestFileMetrics = exports.calculateFileMetrics = exports.calculateMutationTestMetrics = exports.calculateMetrics = void 0;
const helpers_1 = require("./helpers");
const api_1 = require("mutation-testing-report-schema/api");
const helpers_2 = require("./helpers");
const model_1 = require("./model");
const test_model_1 = require("./model/test-model");
import { compareNames, normalize, groupBy } from './helpers/index.js';
import { FileUnderTestModel, MetricsResult, TestFileModel } from './model/index.js';
import { TestStatus } from './model/test-model.js';
const DEFAULT_SCORE = NaN;

@@ -17,7 +12,6 @@ const ROOT_NAME = 'All files';

*/
function calculateMetrics(files) {
const normalizedFiles = (0, helpers_1.normalize)(files, '', (input, name) => new model_1.FileUnderTestModel(input, name));
export function calculateMetrics(files) {
const normalizedFiles = normalize(files, '', (input, name) => new FileUnderTestModel(input, name));
return calculateDirectoryMetrics(ROOT_NAME, normalizedFiles, countFileMetrics);
}
exports.calculateMetrics = calculateMetrics;
/**

@@ -28,7 +22,7 @@ * Calculates the full mutation test metrics from both the files-under-test as well as (optionally) the test files.

*/
function calculateMutationTestMetrics(result) {
export function calculateMutationTestMetrics(result) {
const { files, testFiles, projectRoot = '' } = result;
const fileModelsUnderTest = (0, helpers_1.normalize)(files, projectRoot, (input, name) => new model_1.FileUnderTestModel(input, name));
const fileModelsUnderTest = normalize(files, projectRoot, (input, name) => new FileUnderTestModel(input, name));
if (testFiles && Object.keys(testFiles).length) {
const testFileModels = (0, helpers_1.normalize)(testFiles, projectRoot, (input, name) => new model_1.TestFileModel(input, name));
const testFileModels = normalize(testFiles, projectRoot, (input, name) => new TestFileModel(input, name));
relate(Object.values(fileModelsUnderTest).flatMap((file) => file.mutants), Object.values(testFileModels).flatMap((file) => file.tests));

@@ -45,3 +39,2 @@ return {

}
exports.calculateMutationTestMetrics = calculateMutationTestMetrics;
function calculateRootMetrics(name, files, calculateMetrics) {

@@ -63,10 +56,9 @@ const fileNames = Object.keys(files);

const childResults = toChildModels(files, calculateMetrics);
return new model_1.MetricsResult(name, childResults, metrics);
return new MetricsResult(name, childResults, metrics);
}
function calculateFileMetrics(fileName, file, calculateMetrics) {
return new model_1.MetricsResult(fileName, [], calculateMetrics([file]), file);
export function calculateFileMetrics(fileName, file, calculateMetrics) {
return new MetricsResult(fileName, [], calculateMetrics([file]), file);
}
exports.calculateFileMetrics = calculateFileMetrics;
function toChildModels(files, calculateMetrics) {
const filesByDirectory = (0, helpers_2.groupBy)(Object.entries(files), (namedFile) => namedFile[0].split('/')[0]);
const filesByDirectory = groupBy(Object.entries(files), (namedFile) => namedFile[0].split('/')[0]);
return Object.keys(filesByDirectory)

@@ -84,3 +76,3 @@ .map((directoryName) => {

})
.sort(helpers_1.compareNames);
.sort(compareNames);
}

@@ -109,3 +101,3 @@ function relate(mutants, tests) {

}
function countTestFileMetrics(testFile) {
export function countTestFileMetrics(testFile) {
const tests = testFile.flatMap((_) => _.tests);

@@ -115,19 +107,18 @@ const count = (status) => tests.filter((_) => _.status === status).length;

total: tests.length,
killing: count(test_model_1.TestStatus.Killing),
covering: count(test_model_1.TestStatus.Covering),
notCovering: count(test_model_1.TestStatus.NotCovering),
killing: count(TestStatus.Killing),
covering: count(TestStatus.Covering),
notCovering: count(TestStatus.NotCovering),
};
}
exports.countTestFileMetrics = countTestFileMetrics;
function countFileMetrics(fileResult) {
export function countFileMetrics(fileResult) {
const mutants = fileResult.flatMap((_) => _.mutants);
const count = (status) => mutants.filter((_) => _.status === status).length;
const pending = count(api_1.MutantStatus.Pending);
const killed = count(api_1.MutantStatus.Killed);
const timeout = count(api_1.MutantStatus.Timeout);
const survived = count(api_1.MutantStatus.Survived);
const noCoverage = count(api_1.MutantStatus.NoCoverage);
const runtimeErrors = count(api_1.MutantStatus.RuntimeError);
const compileErrors = count(api_1.MutantStatus.CompileError);
const ignored = count(api_1.MutantStatus.Ignored);
const pending = count('Pending');
const killed = count('Killed');
const timeout = count('Timeout');
const survived = count('Survived');
const noCoverage = count('NoCoverage');
const runtimeErrors = count('RuntimeError');
const compileErrors = count('CompileError');
const ignored = count('Ignored');
const totalDetected = timeout + killed;

@@ -157,3 +148,2 @@ const totalUndetected = survived + noCoverage;

}
exports.countFileMetrics = countFileMetrics;
//# sourceMappingURL=calculateMetrics.js.map

@@ -1,4 +0,4 @@

import type { FileUnderTestModel } from '../model/file-under-test-model';
import type { MetricsResult } from '../model/metrics-result';
import type { Metrics } from '../model/metrics';
import type { FileUnderTestModel } from '../model/file-under-test-model.js';
import type { MetricsResult } from '../model/metrics-result.js';
import type { Metrics } from '../model/metrics.js';
export declare function normalizeFileNames<TIn>(input: Record<string, TIn>, projectRoot?: string): Record<string, TIn>;

@@ -5,0 +5,0 @@ export declare function normalize<TIn, TOut>(input: Record<string, TIn>, projectRoot: string, factory: (input: TIn, relativeFileName: string) => TOut): Record<string, TOut>;

@@ -1,10 +0,6 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.compareNames = exports.determineCommonBasePath = exports.normalize = exports.normalizeFileNames = void 0;
const SEPARATOR = '/';
function normalizeFileNames(input, projectRoot = '') {
export function normalizeFileNames(input, projectRoot = '') {
return normalize(input, projectRoot, (input) => input);
}
exports.normalizeFileNames = normalizeFileNames;
function normalize(input, projectRoot, factory) {
export function normalize(input, projectRoot, factory) {
const fileNames = Object.keys(input);

@@ -19,7 +15,6 @@ const commonBasePath = determineCommonBasePath(fileNames);

}
exports.normalize = normalize;
function normalizeName(fileName) {
return fileName.split(/\/|\\/).filter(Boolean).join('/');
}
function determineCommonBasePath(fileNames) {
export function determineCommonBasePath(fileNames) {
const directories = fileNames.map((fileName) => fileName.split(/\/|\\/).slice(0, -1));

@@ -41,4 +36,3 @@ if (fileNames.length) {

}
exports.determineCommonBasePath = determineCommonBasePath;
function compareNames(a, b) {
export function compareNames(a, b) {
const sortValue = (metricsResult) => {

@@ -55,3 +49,2 @@ // Directories first

}
exports.compareNames = compareNames;
//# sourceMappingURL=file.js.map

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.groupBy = void 0;
function groupBy(arr, criteria) {
export function groupBy(arr, criteria) {
return arr.reduce((acc, item) => {

@@ -14,3 +11,2 @@ const key = criteria(item);

}
exports.groupBy = groupBy;
//# sourceMappingURL=group-by.js.map

@@ -1,5 +0,5 @@

export * from './group-by';
export * from './file';
export * from './text';
export * from './is-not-nullish';
export * from './group-by.js';
export * from './file.js';
export * from './text.js';
export * from './is-not-nullish.js';
//# sourceMappingURL=index.d.ts.map

@@ -1,21 +0,5 @@

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./group-by"), exports);
__exportStar(require("./file"), exports);
__exportStar(require("./text"), exports);
__exportStar(require("./is-not-nullish"), exports);
export * from './group-by.js';
export * from './file.js';
export * from './text.js';
export * from './is-not-nullish.js';
//# sourceMappingURL=index.js.map

@@ -1,8 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isNotNullish = void 0;
function isNotNullish(val) {
export function isNotNullish(val) {
return val !== null && val !== undefined;
}
exports.isNotNullish = isNotNullish;
//# sourceMappingURL=is-not-nullish.js.map

@@ -1,6 +0,11 @@

"use strict";
/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
// The implementation of this file is grabbed and modified from TypeScript source code
Object.defineProperty(exports, "__esModule", { value: true });
exports.computeLineStarts = void 0;
var CharacterCodes;
(function (CharacterCodes) {
CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter";
CharacterCodes[CharacterCodes["lineFeed"] = 10] = "lineFeed";
CharacterCodes[CharacterCodes["carriageReturn"] = 13] = "carriageReturn";
CharacterCodes[CharacterCodes["lineSeparator"] = 8232] = "lineSeparator";
CharacterCodes[CharacterCodes["paragraphSeparator"] = 8233] = "paragraphSeparator";
})(CharacterCodes || (CharacterCodes = {}));
function isLineBreak(ch) {

@@ -17,8 +22,8 @@ // ES5 7.3:

// breaking characters are treated as white space but not as line terminators.
return (ch === 10 /* CharacterCodes.lineFeed */ ||
ch === 13 /* CharacterCodes.carriageReturn */ ||
ch === 8232 /* CharacterCodes.lineSeparator */ ||
ch === 8233 /* CharacterCodes.paragraphSeparator */);
return (ch === CharacterCodes.lineFeed ||
ch === CharacterCodes.carriageReturn ||
ch === CharacterCodes.lineSeparator ||
ch === CharacterCodes.paragraphSeparator);
}
function computeLineStarts(text) {
export function computeLineStarts(text) {
const result = [];

@@ -37,4 +42,4 @@ let pos = 0;

switch (ch) {
case 13 /* CharacterCodes.carriageReturn */:
if (text.charCodeAt(pos) === 10 /* CharacterCodes.lineFeed */) {
case CharacterCodes.carriageReturn:
if (text.charCodeAt(pos) === CharacterCodes.lineFeed) {
pos++;

@@ -44,7 +49,7 @@ }

break;
case 10 /* CharacterCodes.lineFeed */:
case CharacterCodes.lineFeed:
progressLineStart(pos);
break;
default:
if (ch > 127 /* CharacterCodes.maxAsciiCharacter */ && isLineBreak(ch)) {
if (ch > CharacterCodes.maxAsciiCharacter && isLineBreak(ch)) {
progressLineStart(pos);

@@ -58,3 +63,2 @@ }

}
exports.computeLineStarts = computeLineStarts;
//# sourceMappingURL=text.js.map

@@ -1,5 +0,6 @@

export { calculateMetrics, calculateMutationTestMetrics } from './calculateMetrics';
export { aggregateResultsByModule } from './aggregate';
export { normalizeFileNames } from './helpers';
export { MetricsResult, Metrics, TestMetrics, TestModel, FileUnderTestModel, TestFileModel, MutantModel, MutationTestMetricsResult, TestStatus, } from './model';
export { calculateMetrics, calculateMutationTestMetrics } from './calculateMetrics.js';
export { aggregateResultsByModule } from './aggregate.js';
export { normalizeFileNames } from './helpers/index.js';
export { MetricsResult, TestModel, FileUnderTestModel, TestFileModel, MutantModel, TestStatus } from './model/index.js';
export type { Metrics, TestMetrics, MutationTestMetricsResult } from './model/index.js';
//# sourceMappingURL=index.d.ts.map

@@ -1,18 +0,5 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestStatus = exports.MutantModel = exports.TestFileModel = exports.FileUnderTestModel = exports.TestModel = exports.MetricsResult = exports.normalizeFileNames = exports.aggregateResultsByModule = exports.calculateMutationTestMetrics = exports.calculateMetrics = void 0;
var calculateMetrics_1 = require("./calculateMetrics");
Object.defineProperty(exports, "calculateMetrics", { enumerable: true, get: function () { return calculateMetrics_1.calculateMetrics; } });
Object.defineProperty(exports, "calculateMutationTestMetrics", { enumerable: true, get: function () { return calculateMetrics_1.calculateMutationTestMetrics; } });
var aggregate_1 = require("./aggregate");
Object.defineProperty(exports, "aggregateResultsByModule", { enumerable: true, get: function () { return aggregate_1.aggregateResultsByModule; } });
var helpers_1 = require("./helpers");
Object.defineProperty(exports, "normalizeFileNames", { enumerable: true, get: function () { return helpers_1.normalizeFileNames; } });
var model_1 = require("./model");
Object.defineProperty(exports, "MetricsResult", { enumerable: true, get: function () { return model_1.MetricsResult; } });
Object.defineProperty(exports, "TestModel", { enumerable: true, get: function () { return model_1.TestModel; } });
Object.defineProperty(exports, "FileUnderTestModel", { enumerable: true, get: function () { return model_1.FileUnderTestModel; } });
Object.defineProperty(exports, "TestFileModel", { enumerable: true, get: function () { return model_1.TestFileModel; } });
Object.defineProperty(exports, "MutantModel", { enumerable: true, get: function () { return model_1.MutantModel; } });
Object.defineProperty(exports, "TestStatus", { enumerable: true, get: function () { return model_1.TestStatus; } });
export { calculateMetrics, calculateMutationTestMetrics } from './calculateMetrics.js';
export { aggregateResultsByModule } from './aggregate.js';
export { normalizeFileNames } from './helpers/index.js';
export { MetricsResult, TestModel, FileUnderTestModel, TestFileModel, MutantModel, TestStatus } from './model/index.js';
//# sourceMappingURL=index.js.map

@@ -1,5 +0,5 @@

import { FileResult, MutantResult } from 'mutation-testing-report-schema/api';
import { MutantModel } from './mutant-model';
import { SourceFile } from './source-file';
import { MetricsResult } from './metrics-result';
import type { FileResult, MutantResult } from 'mutation-testing-report-schema';
import { MutantModel } from './mutant-model.js';
import { SourceFile } from './source-file.js';
import type { MetricsResult } from './metrics-result.js';
/**

@@ -6,0 +6,0 @@ * Represents a file which was mutated (your production code).

@@ -1,10 +0,7 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FileUnderTestModel = void 0;
const mutant_model_1 = require("./mutant-model");
const source_file_1 = require("./source-file");
import { MutantModel } from './mutant-model.js';
import { SourceFile } from './source-file.js';
/**
* Represents a file which was mutated (your production code).
*/
class FileUnderTestModel extends source_file_1.SourceFile {
export class FileUnderTestModel extends SourceFile {
name;

@@ -37,3 +34,3 @@ /**

this.mutants = input.mutants.map((mutantResult) => {
const mutant = new mutant_model_1.MutantModel(mutantResult);
const mutant = new MutantModel(mutantResult);
mutant.sourceFile = this;

@@ -54,3 +51,2 @@ return mutant;

}
exports.FileUnderTestModel = FileUnderTestModel;
//# sourceMappingURL=file-under-test-model.js.map

@@ -1,9 +0,9 @@

export { FileUnderTestModel } from './file-under-test-model';
export { MetricsResult } from './metrics-result';
export { Metrics } from './metrics';
export { MutantModel } from './mutant-model';
export { MutationTestMetricsResult } from './mutation-test-metrics-result';
export { TestFileModel } from './test-file-model';
export { TestMetrics } from './test-metrics';
export { TestModel, TestStatus } from './test-model';
export { FileUnderTestModel } from './file-under-test-model.js';
export { MetricsResult } from './metrics-result.js';
export type { Metrics } from './metrics.js';
export { MutantModel } from './mutant-model.js';
export type { MutationTestMetricsResult } from './mutation-test-metrics-result.js';
export { TestFileModel } from './test-file-model.js';
export type { TestMetrics } from './test-metrics.js';
export { TestModel, TestStatus } from './test-model.js';
//# sourceMappingURL=index.d.ts.map

@@ -1,15 +0,6 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestStatus = exports.TestModel = exports.TestFileModel = exports.MutantModel = exports.MetricsResult = exports.FileUnderTestModel = void 0;
var file_under_test_model_1 = require("./file-under-test-model");
Object.defineProperty(exports, "FileUnderTestModel", { enumerable: true, get: function () { return file_under_test_model_1.FileUnderTestModel; } });
var metrics_result_1 = require("./metrics-result");
Object.defineProperty(exports, "MetricsResult", { enumerable: true, get: function () { return metrics_result_1.MetricsResult; } });
var mutant_model_1 = require("./mutant-model");
Object.defineProperty(exports, "MutantModel", { enumerable: true, get: function () { return mutant_model_1.MutantModel; } });
var test_file_model_1 = require("./test-file-model");
Object.defineProperty(exports, "TestFileModel", { enumerable: true, get: function () { return test_file_model_1.TestFileModel; } });
var test_model_1 = require("./test-model");
Object.defineProperty(exports, "TestModel", { enumerable: true, get: function () { return test_model_1.TestModel; } });
Object.defineProperty(exports, "TestStatus", { enumerable: true, get: function () { return test_model_1.TestStatus; } });
export { FileUnderTestModel } from './file-under-test-model.js';
export { MetricsResult } from './metrics-result.js';
export { MutantModel } from './mutant-model.js';
export { TestFileModel } from './test-file-model.js';
export { TestModel, TestStatus } from './test-model.js';
//# sourceMappingURL=index.js.map

@@ -1,3 +0,3 @@

import { FileUnderTestModel } from './file-under-test-model';
import { Metrics } from './metrics';
import type { FileUnderTestModel } from './file-under-test-model.js';
import type { Metrics } from './metrics.js';
/**

@@ -4,0 +4,0 @@ * A metrics result of T for a directory or file

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MetricsResult = void 0;
const calculateMetrics_1 = require("../calculateMetrics");
import { countFileMetrics, countTestFileMetrics } from '../calculateMetrics.js';
/**

@@ -10,3 +7,3 @@ * A metrics result of T for a directory or file

*/
class MetricsResult {
export class MetricsResult {
/**

@@ -59,6 +56,6 @@ * The parent of this result (if it has one)

if (files[0].tests) {
this.metrics = (0, calculateMetrics_1.countTestFileMetrics)(files);
this.metrics = countTestFileMetrics(files);
}
else {
this.metrics = (0, calculateMetrics_1.countFileMetrics)(files);
this.metrics = countFileMetrics(files);
}

@@ -68,6 +65,6 @@ return;

if (this.file.tests) {
this.metrics = (0, calculateMetrics_1.countTestFileMetrics)([this.file]);
this.metrics = countTestFileMetrics([this.file]);
}
else {
this.metrics = (0, calculateMetrics_1.countFileMetrics)([this.file]);
this.metrics = countFileMetrics([this.file]);
}

@@ -90,3 +87,2 @@ }

}
exports.MetricsResult = MetricsResult;
//# sourceMappingURL=metrics-result.js.map

@@ -1,3 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};
//# sourceMappingURL=metrics.js.map

@@ -1,4 +0,4 @@

import { Location, MutantResult, MutantStatus } from 'mutation-testing-report-schema/api';
import { FileUnderTestModel } from './file-under-test-model';
import { TestModel } from './test-model';
import type { Location, MutantResult, MutantStatus } from 'mutation-testing-report-schema';
import type { FileUnderTestModel } from './file-under-test-model.js';
import type { TestModel } from './test-model.js';
/**

@@ -5,0 +5,0 @@ * Represent a model of a mutant that contains its test relationship

@@ -1,4 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MutantModel = void 0;
function assertSourceFileDefined(sourceFile) {

@@ -12,3 +9,3 @@ if (sourceFile === undefined) {

*/
class MutantModel {
export class MutantModel {
// MutantResult properties

@@ -100,3 +97,2 @@ coveredBy;

}
exports.MutantModel = MutantModel;
//# sourceMappingURL=mutant-model.js.map

@@ -1,6 +0,6 @@

import { MetricsResult } from './metrics-result';
import { FileUnderTestModel } from './file-under-test-model';
import { TestMetrics } from './test-metrics';
import { Metrics } from './metrics';
import { TestFileModel } from './test-file-model';
import type { MetricsResult } from './metrics-result.js';
import type { FileUnderTestModel } from './file-under-test-model.js';
import type { TestMetrics } from './test-metrics.js';
import type { Metrics } from './metrics.js';
import type { TestFileModel } from './test-file-model.js';
export interface MutationTestMetricsResult {

@@ -7,0 +7,0 @@ systemUnderTestMetrics: MetricsResult<FileUnderTestModel, Metrics>;

@@ -1,3 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};
//# sourceMappingURL=mutation-test-metrics-result.js.map

@@ -1,2 +0,2 @@

import { OpenEndLocation } from 'mutation-testing-report-schema/api';
import type { OpenEndLocation } from 'mutation-testing-report-schema';
export declare function assertSourceDefined(source: string | undefined): asserts source;

@@ -3,0 +3,0 @@ export declare abstract class SourceFile {

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SourceFile = exports.assertSourceDefined = void 0;
const helpers_1 = require("../helpers");
function assertSourceDefined(source) {
import { computeLineStarts } from '../helpers/index.js';
export function assertSourceDefined(source) {
if (source === undefined) {

@@ -10,8 +7,7 @@ throw new Error('sourceFile.source is undefined');

}
exports.assertSourceDefined = assertSourceDefined;
class SourceFile {
export class SourceFile {
lineMap;
getLineMap() {
assertSourceDefined(this.source);
return this.lineMap ?? (this.lineMap = (0, helpers_1.computeLineStarts)(this.source));
return this.lineMap ?? (this.lineMap = computeLineStarts(this.source));
}

@@ -27,3 +23,2 @@ /**

}
exports.SourceFile = SourceFile;
//# sourceMappingURL=source-file.js.map

@@ -1,5 +0,6 @@

import { TestFile as TestFile } from 'mutation-testing-report-schema/api';
import { SourceFile } from './source-file';
import { TestModel } from './test-model';
import { MetricsResult, TestMetrics } from '.';
import type { TestFile as TestFile } from 'mutation-testing-report-schema';
import { SourceFile } from './source-file.js';
import { TestModel } from './test-model.js';
import type { MetricsResult } from './metrics-result.js';
import type { TestMetrics } from './test-metrics.js';
/**

@@ -6,0 +7,0 @@ * Represents a file that contains tests

@@ -1,10 +0,7 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestFileModel = void 0;
const source_file_1 = require("./source-file");
const test_model_1 = require("./test-model");
import { SourceFile } from './source-file.js';
import { TestModel } from './test-model.js';
/**
* Represents a file that contains tests
*/
class TestFileModel extends source_file_1.SourceFile {
export class TestFileModel extends SourceFile {
name;

@@ -26,3 +23,3 @@ tests;

this.tests = input.tests.map((testDefinition) => {
const test = new test_model_1.TestModel(testDefinition);
const test = new TestModel(testDefinition);
test.sourceFile = this;

@@ -33,3 +30,2 @@ return test;

}
exports.TestFileModel = TestFileModel;
//# sourceMappingURL=test-file-model.js.map

@@ -1,3 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};
//# sourceMappingURL=test-metrics.js.map

@@ -1,4 +0,4 @@

import { OpenEndLocation, TestDefinition } from 'mutation-testing-report-schema/api';
import { MutantModel } from './mutant-model';
import { TestFileModel } from './test-file-model';
import type { OpenEndLocation, TestDefinition } from 'mutation-testing-report-schema';
import type { MutantModel } from './mutant-model.js';
import type { TestFileModel } from './test-file-model.js';
export declare enum TestStatus {

@@ -5,0 +5,0 @@ Killing = "Killing",

@@ -1,4 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestModel = exports.TestStatus = void 0;
function assertSourceFileDefined(sourceFile) {

@@ -14,3 +11,3 @@ if (sourceFile === undefined) {

}
var TestStatus;
export var TestStatus;
(function (TestStatus) {

@@ -20,4 +17,4 @@ TestStatus["Killing"] = "Killing";

TestStatus["NotCovering"] = "NotCovering";
})(TestStatus || (exports.TestStatus = TestStatus = {}));
class TestModel {
})(TestStatus || (TestStatus = {}));
export class TestModel {
id;

@@ -89,3 +86,2 @@ name;

}
exports.TestModel = TestModel;
//# sourceMappingURL=test-model.js.map
{
"name": "mutation-testing-metrics",
"version": "2.0.5",
"version": "3.0.0",
"description": "Utility functions to calculate mutation testing metrics.",
"type": "module",
"main": "dist/src/index.js",
"typings": "dist/src/index.d.ts",
"exports": {
".": "./dist/src/index.js"
},
"nx": {
"name": "metrics"
},
"scripts": {

@@ -23,3 +29,3 @@ "test": "mocha --forbid-only --forbid-pending -r source-map-support/register dist/test/**/*.js",

"dependencies": {
"mutation-testing-report-schema": "2.0.5"
"mutation-testing-report-schema": "3.0.0"
},

@@ -29,3 +35,3 @@ "devDependencies": {

},
"gitHead": "8c3f6c7d34953aa2758a514728e78866e7b9c269"
"gitHead": "3cd3cf287e456d5bc2da480a42a52d4d7b1e9c2c"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc