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 documented require usage (fix #485) #495

Merged
merged 1 commit into from
Nov 14, 2020
Merged

Conversation

nickmccurdy
Copy link
Member

What: Encouraging the use of the default export from User Event's CJS build

Why: If you don't do this, you'll get errors about properties missing from the top level build (like #485)

How: Destructuring (supported since Node 6, and Node 10 is the oldest supported version)

Checklist:

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

@nickmccurdy
Copy link
Member Author

Do we need to update the CJS types for this or are they already correct?

@codecov
Copy link

codecov bot commented Nov 14, 2020

Codecov Report

Merging #495 (f52442b) into master (95658c6) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #495   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines          615       615           
  Branches       200       200           
=========================================
  Hits           615       615           

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 95658c6...f52442b. Read the comment docs.

@kentcdodds kentcdodds merged commit 4d345d7 into master Nov 14, 2020
@kentcdodds kentcdodds deleted the nickmccurdy-patch-1 branch November 14, 2020 14:29
@nickmccurdy
Copy link
Member Author

If you're using TS with CJS, userEvent will be incorrectly typed as any. Please use this workaround for now:

import userEventModule = require('@testing-library/user-event')
const userEvent = userEventModule.default

@github-actions
Copy link

🎉 This PR is included in version 12.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nickmccurdy
Copy link
Member Author

@all-contributors add @nickmccurdy for docs

@allcontributors
Copy link
Contributor

@nickmccurdy

I've put up a pull request to add @nickmccurdy! 🎉

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.

None yet

2 participants