Closed
Description
cypress-testing-library
version: 3.0.1node
version: 10.13.0yarn
version: 1.13.0
Relevant code or config
cy.queryByText("foo", { timeout: 100 })
What you did:
Tried to change the value of the timeout option on queryByText
.
What happened:
The test correctly waited for the set amount of time (100ms) but TS validation reports an error:
Problem description:
Queries using the SelectorMatcherOptions
type are missing the type definition for the timeout option.
Suggested solution:
If this is not intentional, take the same approach as for MatcherOptions
in #28 – update typings/index.d.ts
.
How it is now:
import {
SelectorMatcherOptions,
Matcher,
MatcherOptions as DTLMatcherOptions,
getByTestId,
} from 'dom-testing-library'
export interface CTLMatcherOptions {
timeout?: number
}
export type MatcherOptions = DTLMatcherOptions | CTLMatcherOptions
How it could be:
import {
SelectorMatcherOptions as DTLSelectorMatcherOptions,
Matcher,
MatcherOptions as DTLMatcherOptions,
getByTestId,
} from 'dom-testing-library'
export interface CTLMatcherOptions {
timeout?: number
}
export type MatcherOptions = DTLMatcherOptions | CTLMatcherOptions
export type SelectorMatcherOptions = DTLSelectorMatcherOptions | CTLMatcherOptions
Metadata
Metadata
Assignees
Labels
No labels