jest-circus
Advanced tools
Comparing version 30.0.0-alpha.2 to 30.0.0-alpha.3
@@ -360,3 +360,3 @@ /*! | ||
error = asyncError; | ||
error.message = originalError.message ? originalError.message : `thrown: ${(0, _prettyFormat.format)(originalError, { | ||
error.message = originalError.message || `thrown: ${(0, _prettyFormat.format)(originalError, { | ||
maxDepth: 3 | ||
@@ -415,3 +415,3 @@ })}`; | ||
const operatorName = getOperatorName(operator, stack); | ||
const trimmedStack = stack.replace(message, '').replace(/AssertionError(.*)/g, ''); | ||
const trimmedStack = stack.replace(message, '').replaceAll(/AssertionError(.*)/g, ''); | ||
if (operatorName === 'doesNotThrow') { | ||
@@ -484,5 +484,5 @@ return ( | ||
const injectGlobalErrorHandlers = parentProcess => { | ||
const uncaughtException = process.listeners('uncaughtException').slice(); | ||
const unhandledRejection = process.listeners('unhandledRejection').slice(); | ||
const rejectionHandled = process.listeners('rejectionHandled').slice(); | ||
const uncaughtException = [...process.listeners('uncaughtException')]; | ||
const unhandledRejection = [...process.listeners('unhandledRejection')]; | ||
const rejectionHandled = [...process.listeners('rejectionHandled')]; | ||
parentProcess.removeAllListeners('uncaughtException'); | ||
@@ -539,2 +539,5 @@ parentProcess.removeAllListeners('unhandledRejection'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; | ||
var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; | ||
var Promise = globalThis[Symbol.for('jest-native-promise')] || globalThis.Promise; | ||
/** | ||
@@ -546,3 +549,7 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
*/ | ||
// Global values can be overwritten by mocks or tests. We'll capture | ||
// the original values in the variables before we require any files. | ||
const { | ||
setTimeout | ||
} = globalThis; | ||
const run = async () => { | ||
@@ -592,3 +599,6 @@ const { | ||
// eslint-disable-next-line no-restricted-globals | ||
parseInt(global[_types.RETRY_TIMES], 10) || 0; | ||
Number.parseInt(global[_types.RETRY_TIMES], 10) || 0; | ||
const waitBeforeRetry = Number.parseInt( | ||
// eslint-disable-next-line no-restricted-globals | ||
global[_types.WAIT_BEFORE_RETRY], 10) || 0; | ||
const deferredRetryTests = []; | ||
@@ -626,2 +636,5 @@ if (rng) { | ||
}); | ||
if (waitBeforeRetry > 0) { | ||
await new Promise(resolve => setTimeout(resolve, waitBeforeRetry)); | ||
} | ||
await _runTest(test, isSkipped); | ||
@@ -677,5 +690,5 @@ numRetriesAvailable--; | ||
test.fn = () => promise; | ||
} catch (err) { | ||
} catch (error) { | ||
test.fn = () => { | ||
throw err; | ||
throw error; | ||
}; | ||
@@ -789,3 +802,2 @@ } | ||
} | ||
try { | ||
@@ -955,3 +967,3 @@ await (0, _utils.callAsyncCircusFn)(test, testContext, { | ||
})); | ||
exports.TEST_TIMEOUT_SYMBOL = exports.STATE_SYM = exports.RETRY_TIMES = exports.LOG_ERRORS_BEFORE_RETRY = void 0; | ||
exports.WAIT_BEFORE_RETRY = exports.TEST_TIMEOUT_SYMBOL = exports.STATE_SYM = exports.RETRY_TIMES = exports.LOG_ERRORS_BEFORE_RETRY = void 0; | ||
var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; | ||
@@ -967,2 +979,3 @@ /** | ||
const RETRY_TIMES = exports.RETRY_TIMES = Symbol.for('RETRY_TIMES'); | ||
const WAIT_BEFORE_RETRY = exports.WAIT_BEFORE_RETRY = Symbol.for('WAIT_BEFORE_RETRY'); | ||
// To pass this value from Runtime object to state we need to use global[sym] | ||
@@ -1293,3 +1306,3 @@ const TEST_TIMEOUT_SYMBOL = exports.TEST_TIMEOUT_SYMBOL = Symbol.for('TEST_TIMEOUT_SYMBOL'); | ||
status, | ||
testPath: Array.from(testPath) | ||
testPath: [...testPath] | ||
}; | ||
@@ -1300,14 +1313,14 @@ }; | ||
const testResults = []; | ||
for (const child of describeBlock.children) { | ||
switch (child.type) { | ||
case 'describeBlock': | ||
{ | ||
testResults.push(...makeTestResults(child)); | ||
break; | ||
} | ||
case 'test': | ||
{ | ||
testResults.push(makeSingleTestResult(child)); | ||
break; | ||
} | ||
const stack = [[describeBlock, 0]]; | ||
while (stack.length > 0) { | ||
const [currentBlock, childIndex] = stack.pop(); | ||
for (let i = childIndex; i < currentBlock.children.length; i++) { | ||
const child = currentBlock.children[i]; | ||
if (child.type === 'describeBlock') { | ||
stack.push([currentBlock, i + 1], [child, 0]); | ||
break; | ||
} | ||
if (child.type === 'test') { | ||
testResults.push(makeSingleTestResult(child)); | ||
} | ||
} | ||
@@ -1334,2 +1347,3 @@ } | ||
error = errors; | ||
// eslint-disable-next-line unicorn/error-message | ||
asyncError = new Error(); | ||
@@ -1362,3 +1376,3 @@ } | ||
const fullName = ancestorTitles.join(' '); | ||
const title = testNamesPath[testNamesPath.length - 1]; | ||
const title = testNamesPath.at(-1); | ||
// remove title | ||
@@ -1393,3 +1407,3 @@ ancestorTitles.pop(); | ||
failureDetails: testResult.errorsDetailed, | ||
failureMessages: Array.from(testResult.errors), | ||
failureMessages: [...testResult.errors], | ||
fullName, | ||
@@ -1399,3 +1413,3 @@ invocations: testResult.invocations, | ||
numPassingAsserts: testResult.numPassingAsserts, | ||
retryReasons: Array.from(testResult.retryReasons), | ||
retryReasons: [...testResult.retryReasons], | ||
status, | ||
@@ -1402,0 +1416,0 @@ title |
@@ -84,3 +84,6 @@ /*! | ||
} else { | ||
runtime.requireModule(path); | ||
const setupFile = runtime.requireModule(path); | ||
if (typeof setupFile === 'function') { | ||
await setupFile(); | ||
} | ||
} | ||
@@ -141,3 +144,3 @@ } | ||
// Copy the array to prevent memory leaks | ||
results.snapshot.uncheckedKeys = Array.from(uncheckedKeys); | ||
results.snapshot.uncheckedKeys = [...uncheckedKeys]; | ||
}; | ||
@@ -144,0 +147,0 @@ var _default = exports["default"] = jestAdapter; |
{ | ||
"name": "jest-circus", | ||
"version": "30.0.0-alpha.2", | ||
"version": "30.0.0-alpha.3", | ||
"repository": { | ||
@@ -23,6 +23,6 @@ "type": "git", | ||
"dependencies": { | ||
"@jest/environment": "30.0.0-alpha.2", | ||
"@jest/expect": "30.0.0-alpha.2", | ||
"@jest/test-result": "30.0.0-alpha.2", | ||
"@jest/types": "30.0.0-alpha.2", | ||
"@jest/environment": "30.0.0-alpha.3", | ||
"@jest/expect": "30.0.0-alpha.3", | ||
"@jest/test-result": "30.0.0-alpha.3", | ||
"@jest/types": "30.0.0-alpha.3", | ||
"@types/node": "*", | ||
@@ -33,10 +33,10 @@ "chalk": "^4.0.0", | ||
"is-generator-fn": "^2.0.0", | ||
"jest-each": "30.0.0-alpha.2", | ||
"jest-matcher-utils": "30.0.0-alpha.2", | ||
"jest-message-util": "30.0.0-alpha.2", | ||
"jest-runtime": "30.0.0-alpha.2", | ||
"jest-snapshot": "30.0.0-alpha.2", | ||
"jest-util": "30.0.0-alpha.2", | ||
"jest-each": "30.0.0-alpha.3", | ||
"jest-matcher-utils": "30.0.0-alpha.3", | ||
"jest-message-util": "30.0.0-alpha.3", | ||
"jest-runtime": "30.0.0-alpha.3", | ||
"jest-snapshot": "30.0.0-alpha.3", | ||
"jest-util": "30.0.0-alpha.3", | ||
"p-limit": "^3.1.0", | ||
"pretty-format": "30.0.0-alpha.2", | ||
"pretty-format": "30.0.0-alpha.3", | ||
"pure-rand": "^6.0.0", | ||
@@ -62,3 +62,3 @@ "slash": "^3.0.0", | ||
}, | ||
"gitHead": "c04d13d7abd22e47b0997f6027886aed225c9ce4" | ||
"gitHead": "e267aff33d105399f2134bad7c8f82285104f3da" | ||
} |
Sorry, the diff of this file is too big to display
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
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
140006
3776
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@jest/console@30.0.0-alpha.3(transitive)
+ Added@jest/environment@30.0.0-alpha.3(transitive)
+ Added@jest/expect@30.0.0-alpha.3(transitive)
+ Added@jest/expect-utils@30.0.0-alpha.3(transitive)
+ Added@jest/fake-timers@30.0.0-alpha.3(transitive)
+ Added@jest/globals@30.0.0-alpha.3(transitive)
+ Added@jest/schemas@30.0.0-alpha.3(transitive)
+ Added@jest/source-map@30.0.0-alpha.3(transitive)
+ Added@jest/test-result@30.0.0-alpha.3(transitive)
+ Added@jest/transform@30.0.0-alpha.3(transitive)
+ Added@jest/types@30.0.0-alpha.3(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Added@sinclair/typebox@0.32.35(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@6.2.1(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcross-spawn@7.0.3(transitive)
+ Addeddiff-sequences@30.0.0-alpha.3(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedexpect@30.0.0-alpha.3(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedjest-diff@30.0.0-alpha.3(transitive)
+ Addedjest-each@30.0.0-alpha.3(transitive)
+ Addedjest-get-type@30.0.0-alpha.3(transitive)
+ Addedjest-haste-map@30.0.0-alpha.3(transitive)
+ Addedjest-matcher-utils@30.0.0-alpha.3(transitive)
+ Addedjest-message-util@30.0.0-alpha.3(transitive)
+ Addedjest-mock@30.0.0-alpha.3(transitive)
+ Addedjest-regex-util@30.0.0-alpha.3(transitive)
+ Addedjest-resolve@30.0.0-alpha.3(transitive)
+ Addedjest-runtime@30.0.0-alpha.3(transitive)
+ Addedjest-snapshot@30.0.0-alpha.3(transitive)
+ Addedjest-util@30.0.0-alpha.3(transitive)
+ Addedjest-validate@30.0.0-alpha.3(transitive)
+ Addedjest-worker@30.0.0-alpha.3(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedpretty-format@30.0.0-alpha.3(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedsynckit@0.9.2(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)
- Removed@jest/console@30.0.0-alpha.2(transitive)
- Removed@jest/environment@30.0.0-alpha.2(transitive)
- Removed@jest/expect@30.0.0-alpha.2(transitive)
- Removed@jest/expect-utils@30.0.0-alpha.2(transitive)
- Removed@jest/fake-timers@30.0.0-alpha.2(transitive)
- Removed@jest/globals@30.0.0-alpha.2(transitive)
- Removed@jest/schemas@30.0.0-alpha.2(transitive)
- Removed@jest/source-map@30.0.0-alpha.2(transitive)
- Removed@jest/test-result@30.0.0-alpha.2(transitive)
- Removed@jest/transform@30.0.0-alpha.2(transitive)
- Removed@jest/types@30.0.0-alpha.2(transitive)
- Removed@sinclair/typebox@0.31.28(transitive)
- Removeddiff-sequences@30.0.0-alpha.2(transitive)
- Removedexpect@30.0.0-alpha.2(transitive)
- Removedjest-diff@30.0.0-alpha.2(transitive)
- Removedjest-each@30.0.0-alpha.2(transitive)
- Removedjest-get-type@30.0.0-alpha.2(transitive)
- Removedjest-haste-map@30.0.0-alpha.2(transitive)
- Removedjest-matcher-utils@30.0.0-alpha.2(transitive)
- Removedjest-message-util@30.0.0-alpha.2(transitive)
- Removedjest-mock@30.0.0-alpha.2(transitive)
- Removedjest-regex-util@30.0.0-alpha.2(transitive)
- Removedjest-resolve@30.0.0-alpha.2(transitive)
- Removedjest-runtime@30.0.0-alpha.2(transitive)
- Removedjest-snapshot@30.0.0-alpha.2(transitive)
- Removedjest-util@30.0.0-alpha.2(transitive)
- Removedjest-validate@30.0.0-alpha.2(transitive)
- Removedjest-worker@30.0.0-alpha.2(transitive)
- Removedpretty-format@30.0.0-alpha.2(transitive)
- Removedsynckit@0.8.8(transitive)
Updated@jest/expect@30.0.0-alpha.3
Updated@jest/types@30.0.0-alpha.3
Updatedjest-each@30.0.0-alpha.3
Updatedjest-runtime@30.0.0-alpha.3
Updatedjest-snapshot@30.0.0-alpha.3
Updatedjest-util@30.0.0-alpha.3
Updatedpretty-format@30.0.0-alpha.3