Skip to content

test: Improve test perf for suggestion tests #1220

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

Merged
merged 3 commits into from
Mar 8, 2023

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Mar 8, 2023

Brings down the duration of suggestions.js tests from ~9s to <1s.

Was always bugging me how sluggish suggestions.js tests were. Revisited them during https://github.com/testing-library/dom-testing-library/pull/1215/files and it turns out they're only slow because of real timers.

However, the test is not concerned with time but the suggesions themselves. I originally just set the timeout to 1 for find* queries but this felt noisy and means we might regress in the future.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 8, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 399a184:

Sandbox Source
react-testing-library-examples Configuration

@codecov
Copy link

codecov bot commented Mar 8, 2023

Codecov Report

Merging #1220 (399a184) into main (3f64545) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main     #1220   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines          992       992           
  Branches       322       322           
=========================================
  Hits           992       992           
Flag Coverage Δ
node-14 100.00% <ø> (ø)
node-16 100.00% <ø> (ø)
node-18 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

MatanBobi
MatanBobi previously approved these changes Mar 8, 2023
Copy link
Member

@MatanBobi MatanBobi left a comment

Choose a reason for hiding this comment

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

Good catch :)

@eps1lon eps1lon merged commit fb069c9 into testing-library:main Mar 8, 2023
@eps1lon eps1lon deleted the test/suggestion-speed branch March 8, 2023 12:22
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