Socket
Socket
Sign inDemoInstall

@jest/reporters

Package Overview
Dependencies
25
Maintainers
6
Versions
132
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 27.5.1 to 28.0.0-alpha.0

24

build/BaseReporter.js

@@ -18,22 +18,12 @@ 'use strict';

function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const {remove: preRunMessageRemove} = _jestUtil().preRunMessage;
class BaseReporter {
constructor() {
_defineProperty(this, '_error', void 0);
}
_error;

@@ -40,0 +30,0 @@ log(message) {

@@ -178,16 +178,8 @@ 'use strict';

function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const FAIL_COLOR = _chalk().default.bold.red;

@@ -198,15 +190,11 @@

class CoverageReporter extends _BaseReporter.default {
_coverageMap;
_globalConfig;
_sourceMapStore;
_options;
_v8CoverageResults;
static filename = __filename;
constructor(globalConfig, options) {
super();
_defineProperty(this, '_coverageMap', void 0);
_defineProperty(this, '_globalConfig', void 0);
_defineProperty(this, '_sourceMapStore', void 0);
_defineProperty(this, '_options', void 0);
_defineProperty(this, '_v8CoverageResults', void 0);
this._coverageMap = _istanbulLibCoverage().default.createCoverageMap({});

@@ -669,3 +657,1 @@ this._globalConfig = globalConfig;

exports.default = CoverageReporter;
_defineProperty(CoverageReporter, 'filename', __filename);

@@ -50,35 +50,22 @@ 'use strict';

function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const TITLE_BULLET = _chalk().default.bold('\u25cf ');
class DefaultReporter extends _BaseReporter.default {
// ANSI clear sequence for the last printed status
_clear; // ANSI clear sequence for the last printed status
_err;
_globalConfig;
_out;
_status;
_bufferedOutput;
static filename = __filename;
constructor(globalConfig) {
super();
_defineProperty(this, '_clear', void 0);
_defineProperty(this, '_err', void 0);
_defineProperty(this, '_globalConfig', void 0);
_defineProperty(this, '_out', void 0);
_defineProperty(this, '_status', void 0);
_defineProperty(this, '_bufferedOutput', void 0);
this._globalConfig = globalConfig;

@@ -254,3 +241,1 @@ this._clear = '';

exports.default = DefaultReporter;
_defineProperty(DefaultReporter, 'filename', __filename);

@@ -7,22 +7,269 @@ /**

*/
import getResultHeader from './getResultHeader';
export type { Config } from '@jest/types';
export type { AggregatedResult, SnapshotSummary, TestResult, } from '@jest/test-result';
export { default as BaseReporter } from './BaseReporter';
export { default as CoverageReporter } from './CoverageReporter';
export { default as DefaultReporter } from './DefaultReporter';
export { default as NotifyReporter } from './NotifyReporter';
export { default as SummaryReporter } from './SummaryReporter';
export { default as VerboseReporter } from './VerboseReporter';
export type { Context, Reporter, ReporterOnStartOptions, SummaryOptions, Test, } from './types';
/// <reference types="node" />
import {AggregatedResult} from '@jest/test-result';
import type {AssertionResult} from '@jest/test-result';
import {Config} from '@jest/types';
import type {FS} from 'jest-haste-map';
import {GlobalConfig} from '@jest/types/build/Config';
import type {ModuleMap} from 'jest-haste-map';
import {ProjectConfig} from '@jest/types/build/Config';
import type Resolver from 'jest-resolve';
import {SnapshotSummary} from '@jest/test-result';
import type {Suite} from '@jest/test-result';
import type {TestCaseResult} from '@jest/test-result';
import {TestResult} from '@jest/test-result';
export {AggregatedResult};
export declare class BaseReporter implements Reporter {
private _error?;
log(message: string): void;
onRunStart(
_results?: AggregatedResult,
_options?: ReporterOnStartOptions,
): void;
onTestCaseResult(_test: Test, _testCaseResult: TestCaseResult): void;
onTestResult(
_test?: Test,
_testResult?: TestResult,
_results?: AggregatedResult,
): void;
onTestStart(_test?: Test): void;
onRunComplete(
_contexts?: Set<Context>,
_aggregatedResults?: AggregatedResult,
): Promise<void> | void;
protected _setError(error: Error): void;
getLastError(): Error | undefined;
}
export {Config};
export declare type Context = {
config: Config.ProjectConfig;
hasteFS: FS;
moduleMap: ModuleMap;
resolver: Resolver;
};
export declare class CoverageReporter extends BaseReporter {
private _coverageMap;
private _globalConfig;
private _sourceMapStore;
private _options;
private _v8CoverageResults;
static readonly filename: string;
constructor(
globalConfig: Config.GlobalConfig,
options?: CoverageReporterOptions,
);
onTestResult(_test: Test, testResult: TestResult): void;
onRunComplete(
contexts: Set<Context>,
aggregatedResults: AggregatedResult,
): Promise<void>;
private _addUntestedFiles;
private _checkThreshold;
private _getCoverageResult;
}
declare type CoverageReporterOptions = {
changedFiles?: Set<Config.Path>;
sourcesRelatedToTestsInChangedFiles?: Set<Config.Path>;
};
export declare class DefaultReporter extends BaseReporter {
private _clear;
private _err;
protected _globalConfig: Config.GlobalConfig;
private _out;
private _status;
private _bufferedOutput;
static readonly filename: string;
constructor(globalConfig: Config.GlobalConfig);
protected __wrapStdio(
stream: NodeJS.WritableStream | NodeJS.WriteStream,
): void;
forceFlushBufferedOutput(): void;
protected __clearStatus(): void;
protected __printStatus(): void;
onRunStart(
aggregatedResults: AggregatedResult,
options: ReporterOnStartOptions,
): void;
onTestStart(test: Test): void;
onTestCaseResult(test: Test, testCaseResult: TestCaseResult): void;
onRunComplete(): void;
onTestResult(
test: Test,
testResult: TestResult,
aggregatedResults: AggregatedResult,
): void;
testFinished(
config: Config.ProjectConfig,
testResult: TestResult,
aggregatedResults: AggregatedResult,
): void;
printTestFileHeader(
_testPath: Config.Path,
config: Config.ProjectConfig,
result: TestResult,
): void;
printTestFileFailureMessage(
_testPath: Config.Path,
_config: Config.ProjectConfig,
result: TestResult,
): void;
}
declare function getResultHeader(
result: TestResult,
globalConfig: Config.GlobalConfig,
projectConfig?: Config.ProjectConfig,
): string;
export declare class NotifyReporter extends BaseReporter {
private _notifier;
private _startRun;
private _globalConfig;
private _context;
static readonly filename: string;
constructor(
globalConfig: Config.GlobalConfig,
startRun: (globalConfig: Config.GlobalConfig) => unknown,
context: TestSchedulerContext,
);
onRunComplete(contexts: Set<Context>, result: AggregatedResult): void;
}
export declare interface Reporter {
readonly onTestResult?: (
test: Test,
testResult: TestResult,
aggregatedResult: AggregatedResult,
) => Promise<void> | void;
readonly onTestFileResult?: (
test: Test,
testResult: TestResult,
aggregatedResult: AggregatedResult,
) => Promise<void> | void;
readonly onTestCaseResult?: (
test: Test,
testCaseResult: TestCaseResult,
) => Promise<void> | void;
readonly onRunStart: (
results: AggregatedResult,
options: ReporterOnStartOptions,
) => Promise<void> | void;
readonly onTestStart?: (test: Test) => Promise<void> | void;
readonly onTestFileStart?: (test: Test) => Promise<void> | void;
readonly onRunComplete: (
contexts: Set<Context>,
results: AggregatedResult,
) => Promise<void> | void;
readonly getLastError: () => Error | void;
}
export declare type ReporterOnStartOptions = {
estimatedTime: number;
showStatus: boolean;
};
export {SnapshotSummary};
export declare type SummaryOptions = {
currentTestCases?: Array<{
test: Test;
testCaseResult: TestCaseResult;
}>;
estimatedTime?: number;
roundTime?: boolean;
width?: number;
};
export declare class SummaryReporter extends BaseReporter {
private _estimatedTime;
private _globalConfig;
static readonly filename: string;
constructor(globalConfig: Config.GlobalConfig);
private _write;
onRunStart(
aggregatedResults: AggregatedResult,
options: ReporterOnStartOptions,
): void;
onRunComplete(
contexts: Set<Context>,
aggregatedResults: AggregatedResult,
): void;
private _printSnapshotSummary;
private _printSummary;
private _getTestSummary;
}
export declare type Test = {
context: Context;
duration?: number;
path: Config.Path;
};
export {TestResult};
declare type TestSchedulerContext = {
firstRun: boolean;
previousSuccess: boolean;
changedFiles?: Set<Config.Path>;
};
export declare const utils: {
formatTestPath: (config: import("@jest/types/build/Config").ProjectConfig | import("@jest/types/build/Config").GlobalConfig, testPath: string) => string;
getResultHeader: typeof getResultHeader;
getSummary: (aggregatedResults: import("@jest/test-result").AggregatedResult, options?: import("./types").SummaryOptions | undefined) => string;
printDisplayName: (config: import("@jest/types/build/Config").ProjectConfig) => string;
relativePath: (config: import("@jest/types/build/Config").ProjectConfig | import("@jest/types/build/Config").GlobalConfig, testPath: string) => {
basename: string;
dirname: string;
};
trimAndFormatPath: (pad: number, config: import("@jest/types/build/Config").ProjectConfig | import("@jest/types/build/Config").GlobalConfig, testPath: string, columns: number) => string;
formatTestPath: (
config: ProjectConfig | GlobalConfig,
testPath: string,
) => string;
getResultHeader: typeof getResultHeader;
getSummary: (
aggregatedResults: AggregatedResult,
options?: SummaryOptions | undefined,
) => string;
printDisplayName: (config: ProjectConfig) => string;
relativePath: (
config: ProjectConfig | GlobalConfig,
testPath: string,
) => {
basename: string;
dirname: string;
};
trimAndFormatPath: (
pad: number,
config: ProjectConfig | GlobalConfig,
testPath: string,
columns: number,
) => string;
};
export declare class VerboseReporter extends DefaultReporter {
protected _globalConfig: Config.GlobalConfig;
static readonly filename: string;
constructor(globalConfig: Config.GlobalConfig);
protected __wrapStdio(
stream: NodeJS.WritableStream | NodeJS.WriteStream,
): void;
static filterTestResults(
testResults: Array<AssertionResult>,
): Array<AssertionResult>;
static groupTestsBySuites(testResults: Array<AssertionResult>): Suite;
onTestResult(
test: Test,
result: TestResult,
aggregatedResults: AggregatedResult,
): void;
private _logTestResults;
private _logSuite;
private _getIcon;
private _logTest;
private _logTests;
private _logTodoOrPendingTest;
private _logLine;
}
export {};

@@ -96,16 +96,8 @@ 'use strict';

function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const isDarwin = process.platform === 'darwin';

@@ -115,13 +107,10 @@ const icon = path().resolve(__dirname, '../assets/jest_logo.png');

class NotifyReporter extends _BaseReporter.default {
_notifier = loadNotifier();
_startRun;
_globalConfig;
_context;
static filename = __filename;
constructor(globalConfig, startRun, context) {
super();
_defineProperty(this, '_notifier', loadNotifier());
_defineProperty(this, '_startRun', void 0);
_defineProperty(this, '_globalConfig', void 0);
_defineProperty(this, '_context', void 0);
this._globalConfig = globalConfig;

@@ -244,4 +233,2 @@ this._startRun = startRun;

_defineProperty(NotifyReporter, 'filename', __filename);
function loadNotifier() {

@@ -248,0 +235,0 @@ try {

@@ -34,16 +34,8 @@ 'use strict';

function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const RUNNING_TEXT = ' RUNS ';

@@ -58,5 +50,5 @@ const RUNNING = _chalk().default.reset.inverse.yellow.bold(RUNNING_TEXT) + ' ';

class CurrentTestList {
_array;
constructor() {
_defineProperty(this, '_array', void 0);
this._array = [];

@@ -99,23 +91,14 @@ }

class Status {
_cache;
_callback;
_currentTests;
_currentTestCases;
_done;
_emitScheduled;
_estimatedTime;
_interval;
_aggregatedResults;
_showStatus;
constructor() {
_defineProperty(this, '_cache', void 0);
_defineProperty(this, '_callback', void 0);
_defineProperty(this, '_currentTests', void 0);
_defineProperty(this, '_currentTestCases', void 0);
_defineProperty(this, '_done', void 0);
_defineProperty(this, '_emitScheduled', void 0);
_defineProperty(this, '_estimatedTime', void 0);
_defineProperty(this, '_interval', void 0);
_defineProperty(this, '_aggregatedResults', void 0);
_defineProperty(this, '_showStatus', void 0);
this._cache = null;

@@ -122,0 +105,0 @@ this._currentTests = new CurrentTestList();

@@ -42,16 +42,8 @@ 'use strict';

function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const TEST_SUMMARY_THRESHOLD = 20;

@@ -88,9 +80,8 @@ const NPM_EVENTS = new Set([

class SummaryReporter extends _BaseReporter.default {
_estimatedTime;
_globalConfig;
static filename = __filename;
constructor(globalConfig) {
super();
_defineProperty(this, '_estimatedTime', void 0);
_defineProperty(this, '_globalConfig', void 0);
this._globalConfig = globalConfig;

@@ -272,3 +263,1 @@ this._estimatedTime = 0;

exports.default = SummaryReporter;
_defineProperty(SummaryReporter, 'filename', __filename);

@@ -34,24 +34,16 @@ 'use strict';

function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const {ICONS} = _jestUtil().specialChars;
class VerboseReporter extends _DefaultReporter.default {
_globalConfig;
static filename = __filename;
constructor(globalConfig) {
super(globalConfig);
_defineProperty(this, '_globalConfig', void 0);
this._globalConfig = globalConfig;

@@ -226,3 +218,1 @@ } // Verbose mode is for debugging. Buffering of output is undesirable.

exports.default = VerboseReporter;
_defineProperty(VerboseReporter, 'filename', __filename);
{
"name": "@jest/reporters",
"description": "Jest's reporters",
"version": "27.5.1",
"version": "28.0.0-alpha.0",
"main": "./build/index.js",

@@ -16,6 +16,6 @@ "types": "./build/index.d.ts",

"@bcoe/v8-coverage": "^0.2.3",
"@jest/console": "^27.5.1",
"@jest/test-result": "^27.5.1",
"@jest/transform": "^27.5.1",
"@jest/types": "^27.5.1",
"@jest/console": "^28.0.0-alpha.0",
"@jest/test-result": "^28.0.0-alpha.0",
"@jest/transform": "^28.0.0-alpha.0",
"@jest/types": "^28.0.0-alpha.0",
"@types/node": "*",

@@ -32,6 +32,6 @@ "chalk": "^4.0.0",

"istanbul-reports": "^3.1.3",
"jest-haste-map": "^27.5.1",
"jest-resolve": "^27.5.1",
"jest-util": "^27.5.1",
"jest-worker": "^27.5.1",
"jest-haste-map": "^28.0.0-alpha.0",
"jest-resolve": "^28.0.0-alpha.0",
"jest-util": "^28.0.0-alpha.0",
"jest-worker": "^28.0.0-alpha.0",
"slash": "^3.0.0",

@@ -44,3 +44,3 @@ "source-map": "^0.6.0",

"devDependencies": {
"@jest/test-utils": "^27.5.1",
"@jest/test-utils": "^28.0.0-alpha.0",
"@types/exit": "^0.1.30",

@@ -55,3 +55,3 @@ "@types/glob": "^7.1.1",

"@types/node-notifier": "^8.0.0",
"mock-fs": "^4.4.1",
"mock-fs": "^5.1.2",
"strip-ansi": "^6.0.0"

@@ -68,3 +68,3 @@ },

"engines": {
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
"node": "^12.13.0 || ^14.15.0 || ^16.13.0 || >=17.0.0"
},

@@ -84,3 +84,3 @@ "repository": {

},
"gitHead": "67c1aa20c5fec31366d733e901fee2b981cb1850"
"gitHead": "89275b08977065d98e42ad71fcf223f4ad169f09"
}
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc