Skip to content

Commit e37d1f4

Browse files
bopferKent C. Dodds
authored and
Kent C. Dodds
committed
fix(TS): findBy* typings: Remove Error as a possible return value (#239)
* Remove Error as a possible return value since errors are thrown * docs: fix a typo to kick the codecov build
1 parent ba251ed commit e37d1f4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ your team down.
6565

6666
The `dom-testing-library` is a very light-weight solution for testing DOM nodes
6767
(whether simulated with [`JSDOM`](https://github.com/jsdom/jsdom) as provided by
68-
default with [jest][] or in the browser). The main utilities it provides involve
68+
default with [Jest][] or in the browser). The main utilities it provides involve
6969
querying the DOM for nodes in a way that's similar to how the user finds
7070
elements on the page. In this way, the library helps ensure your tests give you
7171
confidence in your UI code. The `dom-testing-library`'s primary guiding

typings/queries.d.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export type FindAllByBoundAttribute = (
1919
id: Matcher,
2020
options?: MatcherOptions,
2121
waitForElementOptions?: WaitForElementOptions
22-
) => Promise<HTMLElement[]> | Error
22+
) => Promise<HTMLElement[]>
2323

2424
export type GetByBoundAttribute = (
2525
container: HTMLElement,
@@ -32,7 +32,7 @@ export type FindByBoundAttribute = (
3232
id: Matcher,
3333
options?: MatcherOptions,
3434
waitForElementOptions?: WaitForElementOptions
35-
) => Promise<HTMLElement> | Error
35+
) => Promise<HTMLElement>
3636

3737
export type QueryByText = (
3838
container: HTMLElement,
@@ -51,7 +51,7 @@ export type FindAllByText = (
5151
id: Matcher,
5252
options?: SelectorMatcherOptions,
5353
waitForElementOptions?: WaitForElementOptions
54-
) => Promise<HTMLElement[]> | Error
54+
) => Promise<HTMLElement[]>
5555

5656
export type GetByText = (
5757
container: HTMLElement,
@@ -64,7 +64,7 @@ export type FindByText = (
6464
id: Matcher,
6565
options?: SelectorMatcherOptions,
6666
waitForElementOptions?: WaitForElementOptions
67-
) => Promise<HTMLElement> | Error
67+
) => Promise<HTMLElement>
6868

6969
export const getByLabelText: GetByText
7070
export const getAllByLabelText: AllByText

0 commit comments

Comments
 (0)