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

fix(type): catch internal promise rejections #635

Merged
merged 4 commits into from Mar 30, 2021
Merged

fix(type): catch internal promise rejections #635

merged 4 commits into from Mar 30, 2021

Conversation

ph-fritsche
Copy link
Member

@ph-fritsche ph-fritsche commented Mar 30, 2021

What:

Fix UncaughtPromiseRejectionWarning for synchronous userEvent.type() that previously slipped through out catch.
Promise rejections are reported per console.error.

Asynchronous calls remain unaffected. Users can and have to handle promise rejections themselves.

Also includes an improved error message for undefined characters and adds test coverage for the error messages.

Why:

Close #633

How:

Return the internal promise if it is not awaited.

Checklist:

  • N/A Documentation
  • Tests
  • Ready to be merged

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 30, 2021

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 bde25bc:

Sandbox Source
userEvent-PR-template Configuration

@codecov
Copy link

codecov bot commented Mar 30, 2021

Codecov Report

Merging #635 (bde25bc) into master (54a10f5) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #635   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           49        49           
  Lines          911       917    +6     
  Branches       361       363    +2     
=========================================
+ Hits           911       917    +6     
Impacted Files Coverage Δ
src/keyboard/getNextKeyDef.ts 100.00% <100.00%> (ø)
src/type/typeImplementation.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54a10f5...bde25bc. Read the comment docs.

@ph-fritsche ph-fritsche merged commit 6ae18e3 into master Mar 30, 2021
@ph-fritsche ph-fritsche deleted the fix-633 branch March 30, 2021 11:40
@github-actions
Copy link

🎉 This PR is included in version 13.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

userEvent.type with empty string causes a warning about an unhandled promise rejection
1 participant