Skip to content

Commit 36e1349

Browse files
jpavonKent C. Dodds
authored and
Kent C. Dodds
committed
fix(TS): update typings with dom-testing-library queries and export them (#130)
1 parent de2c5cf commit 36e1349

File tree

3 files changed

+60
-14
lines changed

3 files changed

+60
-14
lines changed

.all-contributorsrc

+9
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,15 @@
370370
"code",
371371
"doc"
372372
]
373+
},
374+
{
375+
"login": "jpavon",
376+
"name": "Julio Pavón",
377+
"avatar_url": "https://avatars2.githubusercontent.com/u/1493505?v=4",
378+
"profile": "http://jpavon.com",
379+
"contributions": [
380+
"code"
381+
]
373382
}
374383
]
375384
}

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
[![version][version-badge]][package] [![downloads][downloads-badge]][npmtrends]
1616
[![MIT License][license-badge]][license]
1717

18-
[![All Contributors](https://img.shields.io/badge/all_contributors-37-orange.svg?style=flat-square)](#contributors)
18+
[![All Contributors](https://img.shields.io/badge/all_contributors-38-orange.svg?style=flat-square)](#contributors)
1919
[![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc]
2020
[![Join the community on Spectrum][spectrum-badge]][spectrum]
2121

@@ -959,7 +959,7 @@ Thanks goes to these people ([emoji key][emojis]):
959959
| [<img src="https://avatars1.githubusercontent.com/u/29602306?v=4" width="100px;"/><br /><sub><b>Michal Baranowski</b></sub>](https://twitter.com/baranovskim)<br />[📝](#blog-mbaranovski "Blogposts") [✅](#tutorial-mbaranovski "Tutorials") | [<img src="https://avatars3.githubusercontent.com/u/13985684?v=4" width="100px;"/><br /><sub><b>Arthur Puthin</b></sub>](https://github.com/aputhin)<br />[📖](https://github.com/kentcdodds/react-testing-library/commits?author=aputhin "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/21194045?v=4" width="100px;"/><br /><sub><b>Thomas Chia</b></sub>](https://github.com/thchia)<br />[💻](https://github.com/kentcdodds/react-testing-library/commits?author=thchia "Code") [📖](https://github.com/kentcdodds/react-testing-library/commits?author=thchia "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/20430611?v=4" width="100px;"/><br /><sub><b>Thiago Galvani</b></sub>](http://ilegra.com/)<br />[📖](https://github.com/kentcdodds/react-testing-library/commits?author=thiagopaiva99 "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/19828824?v=4" width="100px;"/><br /><sub><b>Christian</b></sub>](http://Chriswcs.github.io)<br />[⚠️](https://github.com/kentcdodds/react-testing-library/commits?author=ChrisWcs "Tests") | [<img src="https://avatars3.githubusercontent.com/u/1571667?v=4" width="100px;"/><br /><sub><b>Alex Krolick</b></sub>](https://alexkrolick.com)<br />[💬](#question-alexkrolick "Answering Questions") [📖](https://github.com/kentcdodds/react-testing-library/commits?author=alexkrolick "Documentation") [💡](#example-alexkrolick "Examples") [🤔](#ideas-alexkrolick "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/1239401?v=4" width="100px;"/><br /><sub><b>Johann Hubert Sonntagbauer</b></sub>](https://github.com/johann-sonntagbauer)<br />[💻](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") |
960960
| [<img src="https://avatars2.githubusercontent.com/u/2224291?v=4" width="100px;"/><br /><sub><b>Maddi Joyce</b></sub>](http://www.maddijoyce.com)<br />[💻](https://github.com/kentcdodds/react-testing-library/commits?author=maddijoyce "Code") | [<img src="https://avatars2.githubusercontent.com/u/10080111?v=4" width="100px;"/><br /><sub><b>Ryan Vice</b></sub>](http://www.vicesoftware.com)<br />[📖](https://github.com/kentcdodds/react-testing-library/commits?author=RyanAtViceSoftware "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/7942604?v=4" width="100px;"/><br /><sub><b>Ian Wilson</b></sub>](https://ianwilson.io)<br />[📝](#blog-iwilsonq "Blogposts") [✅](#tutorial-iwilsonq "Tutorials") | [<img src="https://avatars2.githubusercontent.com/u/1635491?v=4" width="100px;"/><br /><sub><b>Daniel</b></sub>](https://github.com/InExtremaRes)<br />[🐛](https://github.com/kentcdodds/react-testing-library/issues?q=author%3AInExtremaRes "Bug reports") [💻](https://github.com/kentcdodds/react-testing-library/commits?author=InExtremaRes "Code") | [<img src="https://avatars0.githubusercontent.com/u/767959?v=4" width="100px;"/><br /><sub><b>Giorgio Polvara</b></sub>](https://twitter.com/Gpx)<br />[🐛](https://github.com/kentcdodds/react-testing-library/issues?q=author%3AGpx "Bug reports") [🤔](#ideas-Gpx "Ideas, Planning, & Feedback") | [<img src="https://avatars2.githubusercontent.com/u/132233?v=4" width="100px;"/><br /><sub><b>John Gozde</b></sub>](https://github.com/jgoz)<br />[💻](https://github.com/kentcdodds/react-testing-library/commits?author=jgoz "Code") | [<img src="https://avatars0.githubusercontent.com/u/8203211?v=4" width="100px;"/><br /><sub><b>Sam Horton</b></sub>](https://twitter.com/SavePointSam)<br />[📖](https://github.com/kentcdodds/react-testing-library/commits?author=SavePointSam "Documentation") [💡](#example-SavePointSam "Examples") [🤔](#ideas-SavePointSam "Ideas, Planning, & Feedback") |
961961
| [<img src="https://avatars2.githubusercontent.com/u/10452163?v=4" width="100px;"/><br /><sub><b>Richard Kotze (mobile)</b></sub>](http://www.richardkotze.com)<br />[📖](https://github.com/kentcdodds/react-testing-library/commits?author=rkotze "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/10819833?v=4" width="100px;"/><br /><sub><b>Brahian E. Soto Mercedes</b></sub>](https://github.com/sotobuild)<br />[📖](https://github.com/kentcdodds/react-testing-library/commits?author=sotobuild "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/7151559?v=4" width="100px;"/><br /><sub><b>Benoit de La Forest</b></sub>](https://github.com/bdelaforest)<br />[📖](https://github.com/kentcdodds/react-testing-library/commits?author=bdelaforest "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/6624197?v=4" width="100px;"/><br /><sub><b>Salah</b></sub>](https://github.com/thesalah)<br />[💻](https://github.com/kentcdodds/react-testing-library/commits?author=thesalah "Code") [⚠️](https://github.com/kentcdodds/react-testing-library/commits?author=thesalah "Tests") | [<img src="https://avatars2.githubusercontent.com/u/370054?v=4" width="100px;"/><br /><sub><b>Adam Gordon</b></sub>](http://gordonizer.com)<br />[🐛](https://github.com/kentcdodds/react-testing-library/issues?q=author%3Aicfantv "Bug reports") [💻](https://github.com/kentcdodds/react-testing-library/commits?author=icfantv "Code") | [<img src="https://avatars2.githubusercontent.com/u/471278?v=4" width="100px;"/><br /><sub><b>Matija Marohnić</b></sub>](https://silvenon.com)<br />[📖](https://github.com/kentcdodds/react-testing-library/commits?author=silvenon "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/8015514?v=4" width="100px;"/><br /><sub><b>Justice Mba</b></sub>](https://github.com/Dajust)<br />[📖](https://github.com/kentcdodds/react-testing-library/commits?author=Dajust "Documentation") |
962-
| [<img src="https://avatars2.githubusercontent.com/u/5286559?v=4" width="100px;"/><br /><sub><b>Mark Pollmann</b></sub>](https://markpollmann.com/)<br />[📖](https://github.com/kentcdodds/react-testing-library/commits?author=MarkPollmann "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/1213123?v=4" width="100px;"/><br /><sub><b>Ehtesham Kafeel</b></sub>](https://github.com/ehteshamkafeel)<br />[💻](https://github.com/kentcdodds/react-testing-library/commits?author=ehteshamkafeel "Code") [📖](https://github.com/kentcdodds/react-testing-library/commits?author=ehteshamkafeel "Documentation") |
962+
| [<img src="https://avatars2.githubusercontent.com/u/5286559?v=4" width="100px;"/><br /><sub><b>Mark Pollmann</b></sub>](https://markpollmann.com/)<br />[📖](https://github.com/kentcdodds/react-testing-library/commits?author=MarkPollmann "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/1213123?v=4" width="100px;"/><br /><sub><b>Ehtesham Kafeel</b></sub>](https://github.com/ehteshamkafeel)<br />[💻](https://github.com/kentcdodds/react-testing-library/commits?author=ehteshamkafeel "Code") [📖](https://github.com/kentcdodds/react-testing-library/commits?author=ehteshamkafeel "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/1493505?v=4" width="100px;"/><br /><sub><b>Julio Pavón</b></sub>](http://jpavon.com)<br />[💻](https://github.com/kentcdodds/react-testing-library/commits?author=jpavon "Code") |
963963

964964
<!-- ALL-CONTRIBUTORS-LIST:END -->
965965

typings/index.d.ts

+49-12
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,65 @@ type TextMatchOptions = {
1919
}
2020

2121
interface GetsAndQueries {
22-
queryByTestId: BoundFunction<QueryByAttribute>
23-
queryAllByTestId: BoundFunction<AllByAttribute>
24-
getByTestId: BoundFunction<GetByAttribute>
25-
getAllByTestId: BoundFunction<AllByAttribute>
26-
queryByText: BoundFunction<QueryByText>
27-
queryAllByText: BoundFunction<AllByText>
28-
getByText: BoundFunction<GetByText>
29-
getAllByText: BoundFunction<AllByText>
3022
queryByPlaceholderText: BoundFunction<QueryByAttribute>
3123
queryAllByPlaceholderText: BoundFunction<AllByAttribute>
3224
getByPlaceholderText: BoundFunction<GetByAttribute>
3325
getAllByPlaceholderText: BoundFunction<AllByAttribute>
34-
queryByLabelText: BoundFunction<QueryByAttribute>
35-
queryAllByLabelText: BoundFunction<AllByAttribute>
36-
getByLabelText: BoundFunction<GetByAttribute>
37-
getAllByLabelText: BoundFunction<AllByAttribute>
26+
queryByText: BoundFunction<QueryByText>
27+
queryAllByText: BoundFunction<AllByText>
28+
getByText: BoundFunction<GetByText>
29+
getAllByText: BoundFunction<AllByText>
30+
queryByLabelText: BoundFunction<QueryByText>
31+
queryAllByLabelText: BoundFunction<AllByText>
32+
getByLabelText: BoundFunction<GetByText>
33+
getAllByLabelText: BoundFunction<AllByText>
3834
queryByAltText: BoundFunction<QueryByAttribute>
3935
queryAllByAltText: BoundFunction<AllByAttribute>
4036
getByAltText: BoundFunction<GetByAttribute>
4137
getAllByAltText: BoundFunction<AllByAttribute>
38+
queryByTestId: BoundFunction<QueryByAttribute>
39+
queryAllByTestId: BoundFunction<AllByAttribute>
40+
getByTestId: BoundFunction<GetByAttribute>
41+
getAllByTestId: BoundFunction<AllByAttribute>
42+
queryByTitle: BoundFunction<QueryByAttribute>
43+
queryAllByTitle: BoundFunction<AllByAttribute>
44+
getByTitle: BoundFunction<GetByAttribute>
45+
getAllByTitle: BoundFunction<AllByAttribute>
46+
queryByValue: BoundFunction<QueryByAttribute>
47+
queryAllByValue: BoundFunction<AllByAttribute>
48+
getByValue: BoundFunction<GetByAttribute>
49+
getAllByValue: BoundFunction<AllByAttribute>
4250
}
4351

52+
export const queryByPlaceholderText: QueryByAttribute
53+
export const queryAllByPlaceholderText: AllByAttribute
54+
export const getByPlaceholderText: GetByAttribute
55+
export const getAllByPlaceholderText: AllByAttribute
56+
export const queryByText: QueryByText
57+
export const queryAllByText: AllByText
58+
export const getByText: GetByText
59+
export const getAllByText: AllByText
60+
export const queryByLabelText: QueryByText
61+
export const queryAllByLabelText: AllByText
62+
export const getByLabelText: GetByText
63+
export const getAllByLabelText: AllByText
64+
export const queryByAltText: QueryByAttribute
65+
export const queryAllByAltText: AllByAttribute
66+
export const getByAltText: GetByAttribute
67+
export const getAllByAltText: AllByAttribute
68+
export const queryByTestId: QueryByAttribute
69+
export const queryAllByTestId: AllByAttribute
70+
export const getByTestId: GetByAttribute
71+
export const getAllByTestId: AllByAttribute
72+
export const queryByTitle: QueryByAttribute
73+
export const queryAllByTitle: AllByAttribute
74+
export const getByTitle: GetByAttribute
75+
export const getAllByTitle: AllByAttribute
76+
export const queryByValue: QueryByAttribute
77+
export const queryAllByValue: AllByAttribute
78+
export const getByValue: GetByAttribute
79+
export const getAllByValue: AllByAttribute
80+
4481
export interface RenderResult extends GetsAndQueries {
4582
container: HTMLDivElement
4683
debug: () => void

0 commit comments

Comments
 (0)