Skip to content

fix(TS): declare first parameter of screen.debug as optional #573

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 1 commit into from
May 14, 2020
Merged

fix(TS): declare first parameter of screen.debug as optional #573

merged 1 commit into from
May 14, 2020

Conversation

simrobin
Copy link
Contributor

What: Typings of screen.debug helper does not reflect prettyDOM signature

Why: Prevent this kind of error when calling screen.debug() without params from a typescript file:

node_modules/@testing-library/dom/types/screen.d.ts:11:9
11         element: Element | HTMLDocument | Array<Element | HTMLDocument>,
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An argument for 'element' was not provided.

How: Updated typings

Checklist:

  • Documentation added to the
    docs site N/A but the doc already mention that we can use screen.debug()
  • I've prepared a PR for types targeting
    DefinitelyTyped <- Is this still maintained since it was migrated to this repo?
  • Tests N/A
  • Ready to be merged

@codesandbox-ci
Copy link

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 146ea31:

Sandbox Source
silly-feynman-2syc6 Configuration

@codecov
Copy link

codecov bot commented May 14, 2020

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #573   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines          462       462           
  Branches       114       114           
=========================================
  Hits           462       462           

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 eb4e0d7...146ea31. Read the comment docs.

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Ah yes, thank you 👍

@kentcdodds kentcdodds merged commit dcad11b into testing-library:master May 14, 2020
@kentcdodds
Copy link
Member

🎉 This PR is included in version 7.5.5 🎉

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.

2 participants