Skip to content
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

fix: Remove errant export of GetByRoleMatcher, fixing type checking in some TS configurations #575

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions types/matchers.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {ARIARole} from 'aria-query'

// Get autocomplete for ARIARole union types, while still supporting another string
// Ref: https://github.com/microsoft/TypeScript/issues/29729#issuecomment-567871939
export type ByRoleMatcher = ARIARole | (string & {})
import {type ARIARole} from 'aria-query'

declare namespace matchers {
interface TestingLibraryMatchers<E, R> {
Expand Down Expand Up @@ -621,7 +617,11 @@ declare namespace matchers {
* @see
* [testing-library/jest-dom#tohaverole](https://github.com/testing-library/jest-dom#tohaverole)
*/
toHaveRole(role: ByRoleMatcher): R
toHaveRole(
// Get autocomplete for ARIARole union types, while still supporting another string
// Ref: https://github.com/microsoft/TypeScript/issues/29729#issuecomment-567871939
role: ARIARole | (string & {}),
): R
/**
* @description
* This allows you to check whether the given element is partially checked.
Expand Down
Loading