Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added skipped and focused status to FormattedTestResult #13700

Merged
merged 9 commits into from Dec 31, 2022

Conversation

lpizzinidev
Copy link
Contributor

fix #5711

Summary

Added the skipped and focused status to FormattedTestResult as suggested in this comment.
In my implementation, I consider the test skipped if the testResult.skipped flag is true.
I consider the test focused if there are still pending tests and no failures occur.
Let me know if this is the correct approach or if changes need to be made.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you add a changelog entry?

testResults: [skippedAssertion],
},
],
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
};
} as AggregatedResult;

title: 'is still pending',
};

const skippedResults: AggregatedResult = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const skippedResults: AggregatedResult = {
const skippedResults = {

numPendingTests: 2,
numTodoTests: 2,
perfStats: {end: 2, runtime: 1, slow: false, start: 1},
// @ts-expect-error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of @ts-expect-error it would be better to use casting (see other suggestions) in all tests of this file.

I see that @ts-expect-error was already present here and you just followed the pattern. It works, but casting feels somewhat cleaner.

Suggested change
// @ts-expect-error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Applied changes (thank you for the feedback).
The pipeline keeps failing but I don't think it is related to my changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect. Thanks! Apologies about misleading suggestion before, I just noticed that all AssertionResult casts are actually unnecessary. Could you remove them, please?

There is an odd issue with type checks on CI. Hard to debug, because all works smoothly locally. I was trying to find the root of this problem, but no luck so far. Can be ignored for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pipelines are a nightmare to debug 😄
When you'll have the time, I have 2 open PRs which should be ready for review (#13639 and #13607).

@@ -6,7 +6,7 @@
*/

import formatTestResults from '../formatTestResults';
import {AggregatedResult} from '../types';
import type {AggregatedResult, AssertionResult} from '../types';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimenB It was unnecessary to add AssertionResult. My mistake, see: #13700 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't hurt

@SimenB SimenB changed the title feature: Added skipped and focused status to FormattedTestResult feat: Added skipped and focused status to FormattedTestResult Dec 31, 2022
@SimenB SimenB merged commit f7132ef into jestjs:main Dec 31, 2022
@lpizzinidev lpizzinidev deleted the 5711-test-result branch December 31, 2022 11:23
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logging only in fit mode
4 participants