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

Merge extended matchers with the global namespace #9

Merged
merged 1 commit into from
Jul 15, 2019

Conversation

marnusw
Copy link
Contributor

@marnusw marnusw commented Jul 14, 2019

What:

Fixes TypeScript failing to find extended expect methods
Closes #7

How:

By default a d.ts file augments the global namespace. As soon as an import or export is used in the d.ts file it changes to a module definition. This makes it necessary to use declare global {} to add to the global namespace explicitly. In jest-dom/extend-expect.d.ts which the current implementation is based on there are no imports which, I believe, is why it works fine.

Checklist:

  • Documentation added to the
    docs (N/A)
  • Typescript definitions updated
  • Tests (N/A)
  • Ready to be merged

@codecov-io
Copy link

codecov-io commented Jul 14, 2019

Codecov Report

Merging #9 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #9   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           8      8           
  Lines          89     89           
  Branches       23     23           
=====================================
  Hits           89     89

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 96b5d38...2a0e580. Read the comment docs.

@bcarroll22
Copy link
Collaborator

Alright cool! Thanks for adding this...

@allcontributors can you please add @marnusw for code?

@allcontributors
Copy link
Contributor

@bcarroll22

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

@bcarroll22 bcarroll22 merged commit 2925c0a into testing-library:master Jul 15, 2019
@bcarroll22
Copy link
Collaborator

🎉 This PR is included in version 3.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@marnusw marnusw deleted the globalMatcherTypes branch July 15, 2019 18:56
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.

TypeScript fails to find extended expect methods
3 participants