pass startedAt onTestCaseResult
Summary
This PR is to provide the started timestamp inside of the TestCaseResult object passed in custom reporter's onTestCaseResult
- Passed started timestamp in
parseSingleTestResult - Typings: Added
startedtype inTestCaseResultObject
if we modify AssertionCountsReporter in e2e/customReporters
onTestCaseResult(test, testCaseResult) {
console.log(
`onTestCaseResult: ${testCaseResult.title}, ` +
`status: ${testCaseResult.status}, ` +
`numExpectations: ${new Date(testCaseResult.startedAt)}`,
);
}
then notice we would get startedAt in onTestCaseResult
Determining test suites to run...onTestCaseResult: adds fail, status: failed, numExpectations: Sun Jun 23 2024 02:02:39 GMT+0530 (India Standard Time)
onTestFileResult testCaseResult 0: adds fail, status: failed, numExpectations: 0
onTestFileResult testCaseResult 0: sample, status: pending, numExpectations: 0
onTestCaseResult: test 1, status: passed, numExpectations: Sun Jun 23 2024 02:02:39 GMT+0530 (India Standard Time)
onTestCaseResult: test 2, status: passed, numExpectations: Sun Jun 23 2024 02:02:39 GMT+0530 (India Standard Time)
onTestFileResult testCaseResult 0: test 1, status: passed, numExpectations: 1
onTestFileResult testCaseResult 1: test 2, status: passed, numExpectations: 1
onTestCaseResult: adds ok, status: passed, numExpectations: Sun Jun 23 2024 02:02:39 GMT+0530 (India Standard Time)
onTestFileResult testCaseResult 0: adds ok, status: passed, numExpectations: 3
onTestCaseResult: sample, status: todo, numExpectations: Sun Jun 23 2024 02:02:40 GMT+0530 (India Standard Time)
onTestFileResult testCaseResult 0: sample, status: todo, numExpectations: 0
Test plan
should not break existing tests
Deploy Preview for jestjs ready!
| Name | Link |
|---|---|
| Latest commit | 550dfba10dd587046f42603f4dae2285c099eabe |
| Latest deploy log | https://app.netlify.com/sites/jestjs/deploys/6696d63a47548e000830f240 |
| Deploy Preview | https://deploy-preview-15145--jestjs.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
reverting changelog as it would cause merge conflict;
changelog added;
[jest-circus, jest-test-result]Pass startedAt timestamp inTestCaseResultObjectseen inonTestCaseResult(#15145)
sure, will add a test case.
https://github.com/jestjs/jest/releases/tag/v30.0.0-alpha.6
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.