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

[@testing-library/jest-dom] Add new type for toHaveStyle matcher #42022

Merged
merged 2 commits into from Feb 3, 2020
Merged

Conversation

lourenci
Copy link
Contributor

Update toHaveStyle matcher type according to testing-library/jest-dom#196.

@typescript-bot
Copy link
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

Comparison details 📊
master #42022 diff
Batch compilation
Memory usage (MiB) 82.4 82.2 -0.2%
Type count 11236 11242 0%
Assignability cache size 34763 34764 0%
Language service
Samples taken 237 241 +2%
Identifiers in tests 237 241 +2%
getCompletionsAtPosition
    Mean duration (ms) 381.4 376.5 -1.3%
    Mean CV 9.3% 9.4%
    Worst duration (ms) 466.3 445.8 -4.4%
    Worst identifier element toHaveValue
getQuickInfoAtPosition
    Mean duration (ms) 365.8 367.3 +0.4%
    Mean CV 10.0% 10.7% +7.3%
    Worst duration (ms) 448.3 446.9 -0.3%
    Worst identifier document toHaveValue

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added the Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. label Jan 31, 2020
@typescript-bot typescript-bot added this to Waiting for Reviewers in Pull Request Status Board Jan 31, 2020
@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Awaiting reviewer feedback labels Jan 31, 2020
@typescript-bot
Copy link
Contributor

typescript-bot commented Jan 31, 2020

@lourenci Thank you for submitting this PR!

🔔 @gnapse @jgoz @smacpherson64 - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

Copy link
Contributor

@jgoz jgoz left a comment

Choose a reason for hiding this comment

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

Thanks for updating this @lourenci, just a couple minor suggestions from me

@@ -28,7 +28,7 @@ declare namespace jest {
toHaveClass(...classNames: string[]): R;
toHaveFocus(): R;
toHaveFormValues(expectedValues: Record<string, unknown>): R;
toHaveStyle(css: string): R;
toHaveStyle(css: string | object): R;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this might be better expressed as string | Record<string, unknown> similar to the one above.

@@ -22,6 +22,7 @@ expect(element).toHaveClass('cls1', 'cls2', 'cls3', 'cls4');
expect(element).toHaveFocus();
expect(element).toHaveFormValues({ foo: 'bar', baz: 1 });
expect(element).toHaveStyle('display: block');
expect(element).toHaveStyle({ display: 'block' });
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor thing, could you add another property that uses a different type, like width: 100 (just to verify that non-string values are also accepted)?

@typescript-bot typescript-bot moved this from Waiting for Reviewers to Needs Author Attention in Pull Request Status Board Feb 1, 2020
@typescript-bot typescript-bot added Revision needed This PR needs code changes before it can be merged. and removed Awaiting reviewer feedback labels Feb 1, 2020
@typescript-bot
Copy link
Contributor

@lourenci One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits or comments. Thank you!

@typescript-bot
Copy link
Contributor

🔔 @jgoz - Thanks for your review of this PR! Can you please look at the new code and update your review status if appropriate?

Copy link
Contributor

@jgoz jgoz left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for doing this!

@typescript-bot typescript-bot moved this from Needs Author Attention to Check and Merge in Pull Request Status Board Feb 1, 2020
@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Merge:Express labels Feb 1, 2020
@typescript-bot
Copy link
Contributor

A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped!

@jessetrinity jessetrinity merged commit 4713e4b into DefinitelyTyped:master Feb 3, 2020
Pull Request Status Board automation moved this from Check and Merge to Done Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Owner Approved A listed owner of this package signed off on the pull request. Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. Popular package This PR affects a popular package (as counted by NPM download counts). Revision needed This PR needs code changes before it can be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants