@jest/reporters
Advanced tools
Comparing version 28.1.3 to 29.0.0-alpha.0
@@ -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))); |
@@ -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" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106066
3208
1
+ Added@jest/console@29.7.0(transitive)
+ Added@jest/schemas@29.6.3(transitive)
+ Added@jest/test-result@29.7.0(transitive)
+ Added@jest/transform@29.7.0(transitive)
+ Added@jest/types@29.6.3(transitive)
+ Added@sinclair/typebox@0.27.8(transitive)
+ Addedjest-haste-map@29.7.0(transitive)
+ Addedjest-message-util@29.7.0(transitive)
+ Addedjest-regex-util@29.6.3(transitive)
+ Addedjest-util@29.7.0(transitive)
+ Addedjest-worker@29.7.0(transitive)
+ Addedpretty-format@29.7.0(transitive)
- Removed@jest/console@28.1.3(transitive)
- Removed@jest/schemas@28.1.3(transitive)
- Removed@jest/test-result@28.1.3(transitive)
- Removed@jest/transform@28.1.3(transitive)
- Removed@jest/types@28.1.3(transitive)
- Removed@sinclair/typebox@0.24.51(transitive)
- Removedconvert-source-map@1.9.0(transitive)
- Removedjest-haste-map@28.1.3(transitive)
- Removedjest-message-util@28.1.3(transitive)
- Removedjest-regex-util@28.0.2(transitive)
- Removedjest-util@28.1.3(transitive)
- Removedjest-worker@28.1.3(transitive)
- Removedpretty-format@28.1.3(transitive)
Updated@jest/types@^29.0.0-alpha.0
Updatedjest-util@^29.0.0-alpha.0
Updatedjest-worker@^29.0.0-alpha.0