Socket
Socket
Sign inDemoInstall

@jest/reporters

Package Overview
Dependencies
Maintainers
6
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jest/reporters - npm Package Compare versions

Comparing version 28.1.3 to 29.0.0-alpha.0

15

build/CoverageReporter.js

@@ -297,3 +297,2 @@ 'use strict';

exposedMethods: ['worker'],
// @ts-expect-error: option does not exist on the node 12 types
forkOptions: {

@@ -588,4 +587,2 @@ serialization: 'json'

mergedCoverages.result.map(async res => {
var _fileTransform$wrappe;
const fileTransform = fileTransforms.get(res.url);

@@ -595,5 +592,3 @@ let sourcemapContent = undefined;

if (
fileTransform !== null &&
fileTransform !== void 0 &&
fileTransform.sourceMapPath &&
fileTransform?.sourceMapPath &&
fs().existsSync(fileTransform.sourceMapPath)

@@ -608,9 +603,3 @@ ) {

res.url,
(_fileTransform$wrappe =
fileTransform === null || fileTransform === void 0
? void 0
: fileTransform.wrapperLength) !== null &&
_fileTransform$wrappe !== void 0
? _fileTransform$wrappe
: 0,
fileTransform?.wrapperLength ?? 0,
fileTransform && sourcemapContent

@@ -617,0 +606,0 @@ ? {

@@ -65,4 +65,2 @@ 'use strict';

function getResultHeader(result, globalConfig, projectConfig) {
var _result$perfStats;
const testPath = result.testFilePath;

@@ -84,7 +82,3 @@ const formattedTestPath = (0, _formatTestPath.default)(

if (
(_result$perfStats = result.perfStats) !== null &&
_result$perfStats !== void 0 &&
_result$perfStats.slow
) {
if (result.perfStats?.slow) {
const runTime = result.perfStats.runtime / 1000;

@@ -91,0 +85,0 @@ testDetail.push(LONG_TEST_COLOR((0, _jestUtil().formatTime)(runTime, 0)));

2

build/getSummary.js

@@ -120,3 +120,3 @@ 'use strict';

const valuesForCurrentTestCases = getValuesCurrentTestCases(
options === null || options === void 0 ? void 0 : options.currentTestCases
options?.currentTestCases
);

@@ -123,0 +123,0 @@ const estimatedTime = (options && options.estimatedTime) || 0;

@@ -34,87 +34,28 @@ 'use strict';

function _classPrivateMethodInitSpec(obj, privateSet) {
_checkPrivateRedeclaration(obj, privateSet);
privateSet.add(obj);
}
function _checkPrivateRedeclaration(obj, privateCollection) {
if (privateCollection.has(obj)) {
throw new TypeError(
'Cannot initialize the same private elements twice on an object'
);
}
}
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;
}
function _classPrivateMethodGet(receiver, privateSet, fn) {
if (!privateSet.has(receiver)) {
throw new TypeError('attempted to get private field on non-instance');
}
return fn;
}
/**
* 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 titleSeparator = ' \u203A ';
var _getMessageDetails = /*#__PURE__*/ new WeakSet();
var _createAnnotation = /*#__PURE__*/ new WeakSet();
class GitHubActionsReporter extends _BaseReporter.default {
constructor(...args) {
super(...args);
static filename = __filename;
_classPrivateMethodInitSpec(this, _createAnnotation);
_classPrivateMethodInitSpec(this, _getMessageDetails);
}
onTestFileResult({context}, {testResults}) {
testResults.forEach(result => {
var _result$retryReasons;
const title = [...result.ancestorTitles, result.title].join(
titleSeparator
);
(_result$retryReasons = result.retryReasons) === null ||
_result$retryReasons === void 0
? void 0
: _result$retryReasons.forEach((retryReason, index) => {
_classPrivateMethodGet(
this,
_createAnnotation,
_createAnnotation2
).call(this, {
..._classPrivateMethodGet(
this,
_getMessageDetails,
_getMessageDetails2
).call(this, retryReason, context.config),
title: `RETRY ${index + 1}: ${title}`,
type: 'warning'
});
});
result.retryReasons?.forEach((retryReason, index) => {
this.#createAnnotation({
...this.#getMessageDetails(retryReason, context.config),
title: `RETRY ${index + 1}: ${title}`,
type: 'warning'
});
});
result.failureMessages.forEach(failureMessage => {
_classPrivateMethodGet(
this,
_createAnnotation,
_createAnnotation2
).call(this, {
..._classPrivateMethodGet(
this,
_getMessageDetails,
_getMessageDetails2
).call(this, failureMessage, context.config),
this.#createAnnotation({
...this.#getMessageDetails(failureMessage, context.config),
title,

@@ -126,31 +67,31 @@ type: 'error'

}
}
exports.default = GitHubActionsReporter;
#getMessageDetails(failureMessage, config) {
const {message, stack} = (0, _jestMessageUtil().separateMessageFromStack)(
failureMessage
);
const stackLines = (0, _jestMessageUtil().getStackTraceLines)(stack);
const topFrame = (0, _jestMessageUtil().getTopFrame)(stackLines);
const normalizedStackLines = stackLines.map(line =>
(0, _jestMessageUtil().formatPath)(line, config)
);
const messageText = [message, ...normalizedStackLines].join('\n');
return {
file: topFrame?.file,
line: topFrame?.line,
message: messageText
};
}
function _getMessageDetails2(failureMessage, config) {
const {message, stack} = (0, _jestMessageUtil().separateMessageFromStack)(
failureMessage
);
const stackLines = (0, _jestMessageUtil().getStackTraceLines)(stack);
const topFrame = (0, _jestMessageUtil().getTopFrame)(stackLines);
const normalizedStackLines = stackLines.map(line =>
(0, _jestMessageUtil().formatPath)(line, config)
);
const messageText = [message, ...normalizedStackLines].join('\n');
return {
file: topFrame === null || topFrame === void 0 ? void 0 : topFrame.file,
line: topFrame === null || topFrame === void 0 ? void 0 : topFrame.line,
message: messageText
};
#createAnnotation({file, line, message, title, type}) {
message = (0, _stripAnsi().default)(
// copied from: https://github.com/actions/toolkit/blob/main/packages/core/src/command.ts
message.replace(/%/g, '%25').replace(/\r/g, '%0D').replace(/\n/g, '%0A')
);
this.log(
`\n::${type} file=${file},line=${line},title=${title}::${message}`
);
}
}
function _createAnnotation2({file, line, message, title, type}) {
message = (0, _stripAnsi().default)(
// copied from: https://github.com/actions/toolkit/blob/main/packages/core/src/command.ts
message.replace(/%/g, '%25').replace(/\r/g, '%0D').replace(/\n/g, '%0A')
);
this.log(`\n::${type} file=${file},line=${line},title=${title}::${message}`);
}
_defineProperty(GitHubActionsReporter, 'filename', __filename);
exports.default = GitHubActionsReporter;
{
"name": "@jest/reporters",
"description": "Jest's reporters",
"version": "28.1.3",
"version": "29.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": "^28.1.3",
"@jest/test-result": "^28.1.3",
"@jest/transform": "^28.1.3",
"@jest/types": "^28.1.3",
"@jest/console": "^29.0.0-alpha.0",
"@jest/test-result": "^29.0.0-alpha.0",
"@jest/transform": "^29.0.0-alpha.0",
"@jest/types": "^29.0.0-alpha.0",
"@jridgewell/trace-mapping": "^0.3.13",

@@ -33,5 +33,5 @@ "@types/node": "*",

"istanbul-reports": "^3.1.3",
"jest-message-util": "^28.1.3",
"jest-util": "^28.1.3",
"jest-worker": "^28.1.3",
"jest-message-util": "^29.0.0-alpha.0",
"jest-util": "^29.0.0-alpha.0",
"jest-worker": "^29.0.0-alpha.0",
"slash": "^3.0.0",

@@ -44,3 +44,3 @@ "string-length": "^4.0.1",

"devDependencies": {
"@jest/test-utils": "^28.1.3",
"@jest/test-utils": "^29.0.0-alpha.0",
"@tsd/typescript": "~4.7.4",

@@ -56,3 +56,3 @@ "@types/exit": "^0.1.30",

"@types/node-notifier": "^8.0.0",
"jest-resolve": "^28.1.3",
"jest-resolve": "^29.0.0-alpha.0",
"mock-fs": "^5.1.2",

@@ -70,3 +70,3 @@ "tsd-lite": "^0.5.6"

"engines": {
"node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0"
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
},

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

},
"gitHead": "2cce069800dab3fc8ca7c469b32d2e2b2f7e2bb1"
"gitHead": "6862afb00307b52f32eedee977a9b3041355f184"
}
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