@jest/reporters
Advanced tools
Comparing version 29.7.0 to 30.0.0-alpha.1
@@ -1,9 +0,154 @@ | ||
'use strict'; | ||
/*! | ||
* /** | ||
* * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* * | ||
* * This source code is licensed under the MIT license found in the | ||
* * LICENSE file in the root directory of this source tree. | ||
* * / | ||
*/ | ||
/******/ (() => { // webpackBootstrap | ||
/******/ "use strict"; | ||
/******/ var __webpack_modules__ = ({ | ||
Object.defineProperty(exports, '__esModule', { | ||
/***/ "./src/generateEmptyCoverage.ts": | ||
/***/ ((__unused_webpack_module, exports) => { | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
}); | ||
})); | ||
exports["default"] = generateEmptyCoverage; | ||
function fs() { | ||
const data = _interopRequireWildcard(require("graceful-fs")); | ||
fs = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _istanbulLibCoverage() { | ||
const data = require("istanbul-lib-coverage"); | ||
_istanbulLibCoverage = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _istanbulLibInstrument() { | ||
const data = require("istanbul-lib-instrument"); | ||
_istanbulLibInstrument = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _transform() { | ||
const data = require("@jest/transform"); | ||
_transform = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
async function generateEmptyCoverage(source, filename, globalConfig, config, changedFiles, sourcesRelatedToTestsInChangedFiles) { | ||
const coverageOptions = { | ||
changedFiles, | ||
collectCoverage: globalConfig.collectCoverage, | ||
collectCoverageFrom: globalConfig.collectCoverageFrom, | ||
coverageProvider: globalConfig.coverageProvider, | ||
sourcesRelatedToTestsInChangedFiles | ||
}; | ||
let coverageWorkerResult = null; | ||
if ((0, _transform().shouldInstrument)(filename, coverageOptions, config)) { | ||
if (coverageOptions.coverageProvider === 'v8') { | ||
const stat = fs().statSync(filename); | ||
return { | ||
kind: 'V8Coverage', | ||
result: { | ||
functions: [{ | ||
functionName: '(empty-report)', | ||
isBlockCoverage: true, | ||
ranges: [{ | ||
count: 0, | ||
endOffset: stat.size, | ||
startOffset: 0 | ||
}] | ||
}], | ||
scriptId: '0', | ||
url: filename | ||
} | ||
}; | ||
} | ||
const scriptTransformer = await (0, _transform().createScriptTransformer)(config); | ||
// Transform file with instrumentation to make sure initial coverage data is well mapped to original code. | ||
const { | ||
code | ||
} = await scriptTransformer.transformSourceAsync(filename, source, { | ||
instrument: true, | ||
supportsDynamicImport: true, | ||
supportsExportNamespaceFrom: true, | ||
supportsStaticESM: true, | ||
supportsTopLevelAwait: true | ||
}); | ||
// TODO: consider passing AST | ||
const extracted = (0, _istanbulLibInstrument().readInitialCoverage)(code); | ||
// Check extracted initial coverage is not null, this can happen when using /* istanbul ignore file */ | ||
if (extracted) { | ||
coverageWorkerResult = { | ||
coverage: (0, _istanbulLibCoverage().createFileCoverage)(extracted.coverageData), | ||
kind: 'BabelCoverage' | ||
}; | ||
} | ||
} | ||
return coverageWorkerResult; | ||
} | ||
/***/ }) | ||
/******/ }); | ||
/************************************************************************/ | ||
/******/ // The module cache | ||
/******/ var __webpack_module_cache__ = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ // Check if module is in cache | ||
/******/ var cachedModule = __webpack_module_cache__[moduleId]; | ||
/******/ if (cachedModule !== undefined) { | ||
/******/ return cachedModule.exports; | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = __webpack_module_cache__[moduleId] = { | ||
/******/ // no module.id needed | ||
/******/ // no module.loaded needed | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/************************************************************************/ | ||
var __webpack_exports__ = {}; | ||
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. | ||
(() => { | ||
var exports = __webpack_exports__; | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
exports.worker = worker; | ||
function _exit() { | ||
const data = _interopRequireDefault(require('exit')); | ||
const data = _interopRequireDefault(require("exit")); | ||
_exit = function () { | ||
@@ -15,3 +160,3 @@ return data; | ||
function fs() { | ||
const data = _interopRequireWildcard(require('graceful-fs')); | ||
const data = _interopRequireWildcard(require("graceful-fs")); | ||
fs = function () { | ||
@@ -22,48 +167,6 @@ return data; | ||
} | ||
var _generateEmptyCoverage = _interopRequireDefault( | ||
require('./generateEmptyCoverage') | ||
); | ||
function _getRequireWildcardCache(nodeInterop) { | ||
if (typeof WeakMap !== 'function') return null; | ||
var cacheBabelInterop = new WeakMap(); | ||
var cacheNodeInterop = new WeakMap(); | ||
return (_getRequireWildcardCache = function (nodeInterop) { | ||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop; | ||
})(nodeInterop); | ||
} | ||
function _interopRequireWildcard(obj, nodeInterop) { | ||
if (!nodeInterop && obj && obj.__esModule) { | ||
return obj; | ||
} | ||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { | ||
return {default: obj}; | ||
} | ||
var cache = _getRequireWildcardCache(nodeInterop); | ||
if (cache && cache.has(obj)) { | ||
return cache.get(obj); | ||
} | ||
var newObj = {}; | ||
var hasPropertyDescriptor = | ||
Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var key in obj) { | ||
if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { | ||
var desc = hasPropertyDescriptor | ||
? Object.getOwnPropertyDescriptor(obj, key) | ||
: null; | ||
if (desc && (desc.get || desc.set)) { | ||
Object.defineProperty(newObj, key, desc); | ||
} else { | ||
newObj[key] = obj[key]; | ||
} | ||
} | ||
} | ||
newObj.default = obj; | ||
if (cache) { | ||
cache.set(obj, newObj); | ||
} | ||
return newObj; | ||
} | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : {default: obj}; | ||
} | ||
var _generateEmptyCoverage = _interopRequireDefault(__webpack_require__("./src/generateEmptyCoverage.ts")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
@@ -78,15 +181,21 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
process.on('uncaughtException', err => { | ||
console.error(err.stack); | ||
if (err.stack) { | ||
console.error(err.stack); | ||
} else { | ||
console.error(err); | ||
} | ||
(0, _exit().default)(1); | ||
}); | ||
function worker({config, globalConfig, path, context}) { | ||
return (0, _generateEmptyCoverage.default)( | ||
fs().readFileSync(path, 'utf8'), | ||
path, | ||
globalConfig, | ||
config, | ||
context.changedFiles && new Set(context.changedFiles), | ||
context.sourcesRelatedToTestsInChangedFiles && | ||
new Set(context.sourcesRelatedToTestsInChangedFiles) | ||
); | ||
function worker({ | ||
config, | ||
globalConfig, | ||
path, | ||
context | ||
}) { | ||
return (0, _generateEmptyCoverage.default)(fs().readFileSync(path, 'utf8'), path, globalConfig, config, context.changedFiles && new Set(context.changedFiles), context.sourcesRelatedToTestsInChangedFiles && new Set(context.sourcesRelatedToTestsInChangedFiles)); | ||
} | ||
})(); | ||
module.exports = __webpack_exports__; | ||
/******/ })() | ||
; |
@@ -19,2 +19,3 @@ /** | ||
import {TestResult} from '@jest/test-result'; | ||
import type {WriteStream} from 'tty'; | ||
@@ -74,5 +75,3 @@ export {AggregatedResult}; | ||
constructor(globalConfig: Config.GlobalConfig); | ||
protected __wrapStdio( | ||
stream: NodeJS.WritableStream | NodeJS.WriteStream, | ||
): void; | ||
protected __wrapStdio(stream: NodeJS.WritableStream | WriteStream): void; | ||
forceFlushBufferedOutput(): void; | ||
@@ -169,3 +168,3 @@ protected __clearStatus(): void; | ||
private readonly _globalConfig; | ||
private _context; | ||
private readonly _context; | ||
static readonly filename: string; | ||
@@ -307,5 +306,3 @@ constructor(globalConfig: Config.GlobalConfig, context: ReporterContext); | ||
constructor(globalConfig: Config.GlobalConfig); | ||
protected __wrapStdio( | ||
stream: NodeJS.WritableStream | NodeJS.WriteStream, | ||
): void; | ||
protected __wrapStdio(stream: NodeJS.WritableStream | WriteStream): void; | ||
static filterTestResults( | ||
@@ -312,0 +309,0 @@ testResults: Array<AssertionResult>, |
{ | ||
"name": "@jest/reporters", | ||
"description": "Jest's reporters", | ||
"version": "29.7.0", | ||
"version": "30.0.0-alpha.1", | ||
"main": "./build/index.js", | ||
@@ -10,2 +10,4 @@ "types": "./build/index.d.ts", | ||
"types": "./build/index.d.ts", | ||
"require": "./build/index.js", | ||
"import": "./build/index.mjs", | ||
"default": "./build/index.js" | ||
@@ -17,6 +19,6 @@ }, | ||
"@bcoe/v8-coverage": "^0.2.3", | ||
"@jest/console": "^29.7.0", | ||
"@jest/test-result": "^29.7.0", | ||
"@jest/transform": "^29.7.0", | ||
"@jest/types": "^29.6.3", | ||
"@jest/console": "30.0.0-alpha.1", | ||
"@jest/test-result": "30.0.0-alpha.1", | ||
"@jest/transform": "30.0.0-alpha.1", | ||
"@jest/types": "30.0.0-alpha.1", | ||
"@jridgewell/trace-mapping": "^0.3.18", | ||
@@ -34,5 +36,5 @@ "@types/node": "*", | ||
"istanbul-reports": "^3.1.3", | ||
"jest-message-util": "^29.7.0", | ||
"jest-util": "^29.7.0", | ||
"jest-worker": "^29.7.0", | ||
"jest-message-util": "30.0.0-alpha.1", | ||
"jest-util": "30.0.0-alpha.1", | ||
"jest-worker": "30.0.0-alpha.1", | ||
"slash": "^3.0.0", | ||
@@ -44,3 +46,3 @@ "string-length": "^4.0.1", | ||
"devDependencies": { | ||
"@jest/test-utils": "^29.7.0", | ||
"@jest/test-utils": "30.0.0-alpha.1", | ||
"@tsd/typescript": "^5.0.4", | ||
@@ -56,6 +58,6 @@ "@types/exit": "^0.1.30", | ||
"@types/node-notifier": "^8.0.0", | ||
"jest-resolve": "^29.7.0", | ||
"jest-resolve": "30.0.0-alpha.1", | ||
"mock-fs": "^5.1.2", | ||
"node-notifier": "^10.0.0", | ||
"tsd-lite": "^0.7.0" | ||
"tsd-lite": "^0.8.0" | ||
}, | ||
@@ -71,3 +73,3 @@ "peerDependencies": { | ||
"engines": { | ||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0" | ||
"node": "^16.10.0 || ^18.12.0 || >=20.0.0" | ||
}, | ||
@@ -87,3 +89,3 @@ "repository": { | ||
}, | ||
"gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" | ||
"gitHead": "d005cb2505c041583e0c5636d006e08666a54b63" | ||
} |
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
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
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
113396
7
2887
1
1
+ Added@jest/console@30.0.0-alpha.1(transitive)
+ Added@jest/schemas@30.0.0-alpha.1(transitive)
+ Added@jest/test-result@30.0.0-alpha.1(transitive)
+ Added@jest/transform@30.0.0-alpha.1(transitive)
+ Added@jest/types@30.0.0-alpha.1(transitive)
+ Added@sinclair/typebox@0.31.28(transitive)
+ Addedci-info@4.0.0(transitive)
+ Addedelectron-to-chromium@1.4.815(transitive)
+ Addedjest-haste-map@30.0.0-alpha.1(transitive)
+ Addedjest-message-util@30.0.0-alpha.1(transitive)
+ Addedjest-regex-util@30.0.0-alpha.1(transitive)
+ Addedjest-util@30.0.0-alpha.1(transitive)
+ Addedjest-worker@30.0.0-alpha.1(transitive)
+ Addedpretty-format@30.0.0-alpha.1(transitive)
- Removed@jest/console@29.7.0(transitive)
- Removed@jest/schemas@29.6.3(transitive)
- Removed@jest/test-result@29.7.0(transitive)
- Removed@jest/transform@29.7.0(transitive)
- Removed@jest/types@29.6.3(transitive)
- Removed@sinclair/typebox@0.27.8(transitive)
- Removed@types/graceful-fs@4.1.9(transitive)
- Removedci-info@3.9.0(transitive)
- Removedelectron-to-chromium@1.4.814(transitive)
- Removedjest-haste-map@29.7.0(transitive)
- Removedjest-message-util@29.7.0(transitive)
- Removedjest-regex-util@29.6.3(transitive)
- Removedjest-util@29.7.0(transitive)
- Removedjest-worker@29.7.0(transitive)
- Removedpretty-format@29.7.0(transitive)
Updated@jest/console@30.0.0-alpha.1
Updated@jest/types@30.0.0-alpha.1
Updatedjest-util@30.0.0-alpha.1
Updatedjest-worker@30.0.0-alpha.1