Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/testing-library/jest-dom
/ functions
Functions
182 in github.com/testing-library/jest-dom
⨍
Functions
182
◇
Types & classes
23
↓ 33 callers
Function
checkHtmlElement
(htmlElement, ...args)
src/utils.js:70
↓ 33 callers
Function
render
(html)
src/__tests__/helpers/test-utils.js:3
↓ 26 callers
Function
queryByTestId
src/__tests__/helpers/test-utils.js:6
↓ 15 callers
Function
getMessage
( context, matcher, expectedLabel, expectedValue, receivedLabel, receivedValue, )
src/utils.js:129
↓ 9 callers
Method
toBeChecked
* @description * Assert whether the given element is checked. * * It accepts an `input` of type `checkbox` or `radio` and elements with
types/matchers.d.ts:456
↓ 9 callers
Method
toBeDisabled
* @description * Allows you to check whether an element is disabled from the user's perspective. * * Matches if the element is a form c
types/matchers.d.ts:126
↓ 9 callers
Method
toBeEmpty
* @deprecated * since v5.9.0 * @description * Assert whether an element has content or not. * @example * <span data-testid="n
types/matchers.d.ts:92
↓ 9 callers
Method
toBeEnabled
* @description * Allows you to check whether an element is not disabled from the user's perspective. * * Works like `not.toBeDisabled()
types/matchers.d.ts:146
↓ 9 callers
Method
toBeInTheDOM
* @deprecated * since v1.9.0 * @description * Assert whether a value is a DOM element, or not. Contrary to what its name implies, this
types/matchers.d.ts:37
↓ 9 callers
Method
toBeInTheDocument
* @description * Assert whether an element is present in the document or not. * @example * <svg data-testid="svg-element"></svg> *
types/matchers.d.ts:49
↓ 9 callers
Method
toBeInvalid
* @description * Check if a form element, or the entire `form`, is currently invalid. * * An `input`, `select`, `textarea`, or `form` e
types/matchers.d.ts:165
↓ 9 callers
Method
toBeRequired
* @description * This allows you to check if a form element is currently required. * * An element is required if it is having a `requir
types/matchers.d.ts:183
↓ 9 callers
Method
toBeValid
* @description * Allows you to check if a form element is currently required. * * An `input`, `select`, `textarea`, or `form` element i
types/matchers.d.ts:202
↓ 9 callers
Method
toBeVisible
* @description * This allows you to check if an element is currently visible to the user. * * An element is visible if **all** the foll
types/matchers.d.ts:76
↓ 9 callers
Method
toContainElement
* @description * Allows you to assert whether an element contains another element as a descendant or not. * @example * <span data-testi
types/matchers.d.ts:220
↓ 9 callers
Method
toContainHTML
* @description * Assert whether a string representing a HTML element is contained in another element. * @example * <span data-testid="p
types/matchers.d.ts:231
↓ 9 callers
Method
toHaveAccessibleDescription
* @description * This allows to assert that an element has the expected [accessible description](https://w3c.github.io/accname/). * * Y
types/matchers.d.ts:531
↓ 9 callers
Method
toHaveAccessibleName
* @description * This allows to assert that an element has the expected [accessible name](https://w3c.github.io/accname/). * It is useful, f
types/matchers.d.ts:603
↓ 9 callers
Method
toHaveAttribute
* @description * Allows you to check if a given element has an attribute or not. * * You can also optionally check that the attribute h
types/matchers.d.ts:254
↓ 9 callers
Method
toHaveClass
* @description * Check whether the given element has certain classes within its `class` attribute. * * You must provide at least one cl
types/matchers.d.ts:281
↓ 9 callers
Method
toHaveDescription
* @deprecated * since v5.14.1 * @description * Check the accessible description for an element. * This allows you to check whether
types/matchers.d.ts:505
↓ 9 callers
Method
toHaveDisplayValue
* @description * This allows you to check whether the given form element has the specified displayed value (the one the * end user will see)
types/matchers.d.ts:324
↓ 9 callers
Method
toHaveErrorMessage
* @deprecated * since v5.17.0 * * @description * Check whether the given element has an [ARIA error message](https://www.w3.org/TR
types/matchers.d.ts:725
↓ 9 callers
Method
toHaveFocus
* @description * Assert whether an element has focus or not. * @example * <div> * <input type="text" data-testid="element-to-foc
types/matchers.d.ts:341
↓ 9 callers
Method
toHaveFormValues
* @description * Check if a form or fieldset contains form controls for each given name, and having the specified value. * * Can only b
types/matchers.d.ts:362
↓ 9 callers
Method
toHaveStyle
* @description * Check if an element has specific css properties with specific values applied. * * Only matches if the element has *all
types/matchers.d.ts:385
↓ 9 callers
Method
toHaveTextContent
* @description * Check whether the given element has a text content or not. * * When a string argument is passed through, it will perfo
types/matchers.d.ts:409
↓ 9 callers
Method
toHaveValue
* @description * Check whether the given form element has the specified value. * * Accepts `<input>`, `<select>`, and `<textarea>` elem
types/matchers.d.ts:432
↓ 6 callers
Function
getTag
(element)
src/utils.js:171
↓ 6 callers
Method
toHaveRole
* @description * This allows you to assert that an element has the expected * [role](https://www.w3.org/TR/html-aria/#docconformance).
types/matchers.d.ts:640
↓ 5 callers
Function
deprecate
(name, replacementText)
src/utils.js:158
↓ 5 callers
Method
toBeEmptyDOMElement
* @description * Assert whether an element has content or not. * @example * <span data-testid="not-empty"> * <span data-testid="
types/matchers.d.ts:106
↓ 5 callers
Method
toBePartiallyChecked
* @description * This allows you to check whether the given element is partially checked. * It accepts an input of type checkbox and element
types/matchers.d.ts:682
↓ 5 callers
Method
toContainAnyByAltText
* @description * Assert whether an element contains one or more descendants with the specified alt text. * @example * <img alt="Image D
types/matchers.d.ts:883
↓ 5 callers
Method
toContainAnyByDisplayValue
* @description * Assert whether an element contains one or more descendants with the specified display value. * @example * <select><opt
types/matchers.d.ts:905
↓ 5 callers
Method
toContainAnyByLabelText
* @description * Assert whether an element contains one or more descendants with the specified label text. * @example * <label for="nam
types/matchers.d.ts:927
↓ 5 callers
Method
toContainAnyByPlaceholderText
* @description * Assert whether an element contains one or more descendants with the specified placeholder text. * @example * <input pl
types/matchers.d.ts:949
↓ 5 callers
Method
toContainAnyByRole
* @description * Assert whether an element contains one or more descendants with the specified role. * @example * <div role="alert">Som
types/matchers.d.ts:971
↓ 5 callers
Method
toContainAnyByTestId
* @description * Assert whether an element contains one or more descendants with the specified test ID. * @example * <div data-testid="
types/matchers.d.ts:993
↓ 5 callers
Method
toContainAnyByText
* @description * Assert whether an element contains one or more descendants with the specified text. * @example * <span>Hello world</sp
types/matchers.d.ts:1015
↓ 5 callers
Method
toContainAnyByTitle
* @description * Assert whether an element contains one or more descendants with the specified title. * @example * <h1 title="Page titl
types/matchers.d.ts:1037
↓ 5 callers
Method
toContainOneByAltText
* @description * Assert whether an element contains exactly one descendant with the specified alt text. * @example * <img alt="Image De
types/matchers.d.ts:894
↓ 5 callers
Method
toContainOneByDisplayValue
* @description * Assert whether an element contains exactly one descendant with the specified display value. * @example * <select><opti
types/matchers.d.ts:916
↓ 5 callers
Method
toContainOneByLabelText
* @description * Assert whether an element contains exactly one descendant with the specified label text. * @example * <label for="name
types/matchers.d.ts:938
↓ 5 callers
Method
toContainOneByPlaceholderText
* @description * Assert whether an element contains exactly one descendant with the specified placeholder text. * @example * <input pla
types/matchers.d.ts:960
↓ 5 callers
Method
toContainOneByRole
* @description * Assert whether an element contains exactly one descendant with the specified role. * @example * <div role="alert">Some
types/matchers.d.ts:982
↓ 5 callers
Method
toContainOneByTestId
* @description * Assert whether an element contains exactly one descendant with the specified test ID. * @example * <div data-testid="a
types/matchers.d.ts:1004
↓ 5 callers
Method
toContainOneByText
* @description * Assert whether an element contains exactly one descendant with the specified text. * @example * <span>Hello world</spa
types/matchers.d.ts:1026
↓ 5 callers
Method
toContainOneByTitle
* @description * Assert whether an element contains exactly one descendant with the specified title. * @example * <h1 title="Page title
types/matchers.d.ts:1048
↓ 5 callers
Method
toHaveAccessibleErrorMessage
* @description * This allows you to assert that an element has the expected * [accessible error message](https://w3c.github.io/aria/#aria-er
types/matchers.d.ts:571
↓ 4 callers
Function
normalize
(text)
src/utils.js:167
↓ 3 callers
Function
compareAsSet
(val1, val2)
src/utils.js:233
↓ 3 callers
Function
renderList
(items, mapper)
src/__tests__/to-have-form-values.js:349
↓ 2 callers
Function
canElementBeDisabled
(element)
src/to-be-disabled.js:47
↓ 2 callers
Function
checkHasWindow
(htmlElement, ErrorClass, ...args)
src/utils.js:51
↓ 2 callers
Function
checkNode
(node, ...args)
src/utils.js:61
↓ 2 callers
Function
checkToAppear
(methodName, targetDocumentPosition)
src/to-appear-before.js:30
↓ 2 callers
Function
getSingleElementValue
(element)
src/utils.js:207
↓ 2 callers
Function
isElementDisabled
(element)
src/to-be-disabled.js:52
↓ 2 callers
Function
isElementInvalid
(element)
src/to-be-invalid.js:16
↓ 2 callers
Function
isElementOrAncestorDisabled
(element)
src/to-be-disabled.js:64
↓ 2 callers
Function
isSelected
(value, option)
src/__tests__/to-have-form-values.js:266
↓ 2 callers
Function
isValidInput
()
src/to-be-checked.js:7
↓ 2 callers
Function
isValidInput
()
src/to-be-partially-checked.js:6
↓ 2 callers
Function
match
(element)
src/to-have-role.js:103
↓ 2 callers
Function
renderSelect
(name, label, options, value, multiple)
src/__tests__/to-have-form-values.js:316
↓ 2 callers
Function
toSentence
( array, {wordConnector = ', ', lastWordConnector = ' and '} = {}, )
src/utils.js:224
↓ 1 callers
Function
asFragment
()
src/__tests__/helpers/test-utils.js:9
↓ 1 callers
Function
buildElementRoleList
* Transform the roles map (with required attributes and constraints) to a list * of roles. Each item in the list has functions to match an element ag
src/to-have-role.js:76
↓ 1 callers
Function
createQueryMatcher
* Factory that creates an expect matcher function for the given DOM query. * @param {'Any'|'One'} quantity Whether to match any or one element. * @p
src/query-matchers.js:40
↓ 1 callers
Function
customExpect
( _actual: HTMLElement, )
types/__tests__/jest/jest-custom-expect-types.test.ts:15
↓ 1 callers
Function
customExpect
( _actual: HTMLElement, )
types/__tests__/jest-globals/jest-globals-custom-expect-types.test.ts:16
↓ 1 callers
Function
customExpect
( _actual: HTMLElement, )
types/__tests__/vitest/vitest-custom-expect-types.test.ts:16
↓ 1 callers
Function
customExpect
( _actual: HTMLElement, )
types/__tests__/bun/bun-custom-expect-types.test.ts:17
↓ 1 callers
Function
display
(context, value)
src/utils.js:125
↓ 1 callers
Function
errorFound
()
src/to-be-in-the-document.js:13
↓ 1 callers
Function
errorNotFound
()
src/to-be-in-the-document.js:18
↓ 1 callers
Function
expectedDiff
(diffFn, expected, computedStyles)
src/to-have-style.js:43
↓ 1 callers
Function
getAccessibleValue
(element)
src/utils.js:200
↓ 1 callers
Function
getAllFormValues
(container)
src/to-have-form-values.js:51
↓ 1 callers
Function
getAttributeComment
(stringify, name, value)
src/to-have-attribute.js:7
↓ 1 callers
Function
getDOMElement
(htmlString, selector)
src/__tests__/to-be-invalid.js:22
↓ 1 callers
Function
getExpectedClassNamesAndOptions
(params)
src/to-have-class.js:3
↓ 1 callers
Function
getExpectedValues
(expectedValue)
src/to-have-display-value.js:59
↓ 1 callers
Function
getExplicitOrImplicitRoles
(htmlElement)
src/to-have-role.js:33
↓ 1 callers
Function
getFormValue
(container, name)
src/to-have-form-values.js:32
↓ 1 callers
Function
getImplicitAriaRoles
(currentNode)
src/to-have-role.js:51
↓ 1 callers
Function
getInputValue
(inputElement)
src/utils.js:188
↓ 1 callers
Function
getMultiElementValue
(elements)
src/to-have-form-values.js:10
↓ 1 callers
Function
getNormalizedHtml
(container, htmlText)
src/to-contain-html.js:3
↓ 1 callers
Function
getPureName
(name)
src/to-have-form-values.js:47
↓ 1 callers
Function
getSelectValue
({multiple, options})
src/utils.js:175
↓ 1 callers
Function
getSelection
* Returns the selection from the element. * * @param element {HTMLElement} The element to get the selection from. * @returns {String} The selection
src/to-have-selection.js:9
↓ 1 callers
Function
getSelectorSpecificity
({attributes = []})
src/to-have-role.js:92
↓ 1 callers
Function
getStyleDeclaration
(document, css)
src/to-have-style.js:4
↓ 1 callers
Function
getValues
(tagName, htmlElement)
src/to-have-display-value.js:51
↓ 1 callers
Function
isAncestorDisabled
(element)
src/to-be-disabled.js:56
↓ 1 callers
Function
isAttributeVisible
(element, previousElement)
src/to-be-visible.js:16
↓ 1 callers
Function
isChecked
()
src/to-be-checked.js:29
↓ 1 callers
Function
isCustomElement
(tag)
src/to-be-disabled.js:39
next →
1–100 of 182, ranked by callers