Skip to content
Merged
Changes from 1 commit
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
10 changes: 5 additions & 5 deletions types/matchers.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import {ARIARole} from 'aria-query'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be changed to?

import {type 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 & {})

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