diff --git a/.all-contributorsrc b/.all-contributorsrc
index 99bb1761..06802e81 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -351,6 +351,15 @@
"contributions": [
"doc"
]
+ },
+ {
+ "login": "MarkPollmann",
+ "name": "Mark Pollmann",
+ "avatar_url": "https://avatars2.githubusercontent.com/u/5286559?v=4",
+ "profile": "https://markpollmann.com/",
+ "contributions": [
+ "doc"
+ ]
}
]
}
diff --git a/README.md b/README.md
index e1af7fa8..7f66cc63 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
[![version][version-badge]][package] [![downloads][downloads-badge]][npmtrends]
[![MIT License][license-badge]][license]
-[](#contributors)
+[](#contributors)
[![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc]
[![Join the community on Spectrum][spectrum-badge]][spectrum]
@@ -946,6 +946,7 @@ Thanks goes to these people ([emoji key][emojis]):
| [
Michal Baranowski](https://twitter.com/baranovskim)
[π](#blog-mbaranovski "Blogposts") [β
](#tutorial-mbaranovski "Tutorials") | [
Arthur Puthin](https://github.com/aputhin)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=aputhin "Documentation") | [
Thomas Chia](https://github.com/thchia)
[π»](https://github.com/kentcdodds/react-testing-library/commits?author=thchia "Code") [π](https://github.com/kentcdodds/react-testing-library/commits?author=thchia "Documentation") | [
Thiago Galvani](http://ilegra.com/)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=thiagopaiva99 "Documentation") | [
Christian](http://Chriswcs.github.io)
[β οΈ](https://github.com/kentcdodds/react-testing-library/commits?author=ChrisWcs "Tests") | [
Alex Krolick](https://alexkrolick.com)
[π¬](#question-alexkrolick "Answering Questions") [π](https://github.com/kentcdodds/react-testing-library/commits?author=alexkrolick "Documentation") [π‘](#example-alexkrolick "Examples") [π€](#ideas-alexkrolick "Ideas, Planning, & Feedback") | [
Johann Hubert Sonntagbauer](https://github.com/johann-sonntagbauer)
[π»](https://github.com/kentcdodds/react-testing-library/commits?author=johann-sonntagbauer "Code") [π](https://github.com/kentcdodds/react-testing-library/commits?author=johann-sonntagbauer "Documentation") [β οΈ](https://github.com/kentcdodds/react-testing-library/commits?author=johann-sonntagbauer "Tests") |
| [
Maddi Joyce](http://www.maddijoyce.com)
[π»](https://github.com/kentcdodds/react-testing-library/commits?author=maddijoyce "Code") | [
Ryan Vice](http://www.vicesoftware.com)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=RyanAtViceSoftware "Documentation") | [
Ian Wilson](https://ianwilson.io)
[π](#blog-iwilsonq "Blogposts") [β
](#tutorial-iwilsonq "Tutorials") | [
Daniel](https://github.com/InExtremaRes)
[π](https://github.com/kentcdodds/react-testing-library/issues?q=author%3AInExtremaRes "Bug reports") [π»](https://github.com/kentcdodds/react-testing-library/commits?author=InExtremaRes "Code") | [
Giorgio Polvara](https://twitter.com/Gpx)
[π](https://github.com/kentcdodds/react-testing-library/issues?q=author%3AGpx "Bug reports") [π€](#ideas-Gpx "Ideas, Planning, & Feedback") | [
John Gozde](https://github.com/jgoz)
[π»](https://github.com/kentcdodds/react-testing-library/commits?author=jgoz "Code") | [
Sam Horton](https://twitter.com/SavePointSam)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=SavePointSam "Documentation") [π‘](#example-SavePointSam "Examples") [π€](#ideas-SavePointSam "Ideas, Planning, & Feedback") |
| [
Richard Kotze (mobile)](http://www.richardkotze.com)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=rkotze "Documentation") | [
Brahian E. Soto Mercedes](https://github.com/sotobuild)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=sotobuild "Documentation") | [
Benoit de La Forest](https://github.com/bdelaforest)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=bdelaforest "Documentation") | [
Salah](https://github.com/thesalah)
[π»](https://github.com/kentcdodds/react-testing-library/commits?author=thesalah "Code") [β οΈ](https://github.com/kentcdodds/react-testing-library/commits?author=thesalah "Tests") | [
Adam Gordon](http://gordonizer.com)
[π](https://github.com/kentcdodds/react-testing-library/issues?q=author%3Aicfantv "Bug reports") [π»](https://github.com/kentcdodds/react-testing-library/commits?author=icfantv "Code") | [
Matija MarohniΔ](https://silvenon.com)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=silvenon "Documentation") | [
Justice Mba](https://github.com/Dajust)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=Dajust "Documentation") |
+| [
Mark Pollmann](https://markpollmann.com/)
[π](https://github.com/kentcdodds/react-testing-library/commits?author=MarkPollmann "Documentation") |
diff --git a/typings/index.d.ts b/typings/index.d.ts
index 3623952d..403137fd 100644
--- a/typings/index.d.ts
+++ b/typings/index.d.ts
@@ -48,11 +48,17 @@ export interface RenderResult extends GetsAndQueries {
unmount: VoidFunction
}
+/**
+ * Render into a container which is appended to document.body. It should be used with cleanup.
+ */
export function render(
ui: React.ReactElement,
options?: {container: HTMLElement; baseElement: HTMLElement},
): RenderResult
+/**
+ * When in need to wait for DOM elements to appear, disappear, or change. Prefer waitForElement.
+ */
export function wait(
callback?: () => void,
options?: {
@@ -61,6 +67,9 @@ export function wait(
},
): Promise
+/**
+ * When in need to wait for DOM elements to appear, disappear, or change.
+ */
export function waitForElement(
callback?: () => T,
options?: {
@@ -146,8 +155,14 @@ type FireObject = {
[K in EventType]: (element: HTMLElement, options?: {}) => boolean
}
+/**
+ * Fire DOM events.
+ */
export const fireEvent: FireFunction & FireObject
+/**
+ * Unmounts React trees that were mounted with render.
+ */
export function cleanup(): void
export function getQueriesForElement(element: HTMLElement): GetsAndQueries