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: support slowTestThreshold option #78

Merged
merged 3 commits into from
May 16, 2022
Merged

feat: support slowTestThreshold option #78

merged 3 commits into from
May 16, 2022

Conversation

mrazauskas
Copy link
Contributor

Just could not stop myself – added support for slowTestThreshold option.

Had to rewrite the logic, but that is even better after types were added. I mean, in some files there are more types than code. After refactor all is much cleaner.

Comment on lines +16 to +18
jest.mock('../formatter.js');

jest.mocked(formatTsdResults).mockReturnValue('<mocked failure message>');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a workaround, can’t use module factory because of jestjs/jest#12422. All mock types is a joy to work with, so I’m fine with that little trade off.

ancestorTitles: [],
failureDetails: [],
failureMessages: errorMessage ? [errorMessage] : [],
fullName: TEST_TITLE,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently fullName is set to absolute path of the test file. Not sure if this is a breaking change, or just a fix?

Copy link
Member

Choose a reason for hiding this comment

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

seems fine - we expose the filename via testFilePath

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.

love it 👍

@SimenB SimenB merged commit 05c0626 into jest-community:main May 16, 2022
@SimenB
Copy link
Member

SimenB commented May 16, 2022

@mrazauskas mrazauskas deleted the feat-slowTestThreshold branch May 16, 2022 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants