0.1.18 • Published 2 months ago

@endosama/rescript-jest-dom v0.1.18

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Release @endosama/rescript-jest-dom

rescript-jest-dom

A list of jest-dom bindings for Rescript

Installation

# using npm
npm install @endosama/rescript-jest-dom

# using yarn
yarn add @endosama/rescript-jest-dom

and then add the package as a dependency in your bsconfig.json file:

"bs-dependencies": [
  ...,
  "@endosama/rescript-jest-dom"
]

Usage

open Jest
open Expect
open JestDom

element->expect->toHaveTextContent(#Str("Hello there!")) // pass

Documentation

Automatically generated using chat-gpt. If anything is missing check the jest-dom Documentation

toBeInTheDocument

Asserts that the specified element is in the document.

expect(dom)->ExpectDom.toBeInTheDocument()

toHaveClass

Asserts that the specified element has the given class.

expect(dom)->ExpectDom.toHaveClass(className)

Parameters

  • className: The class to check for.

toHaveAttribute

Asserts that the specified element has the given attribute.

expect(dom)->ExpectDom.toHaveAttribute(attributeName, attributeValue?)

Parameters

  • attributeName: The attribute to check for.
  • attributeValue (optional): The expected value of the attribute. If not provided, only the presence of the attribute is checked.

toHaveTextContent

Asserts that the specified element has the given text content.

expect(dom)->ExpectDom.toHaveTextContent(text)

Parameters

  • text: The text content to check for.

toHaveValue

Asserts that the specified element has the given value.

expect(dom)->ExpectDom.toHaveValue(value)

Parameters

  • value: The value to check for.

toBeChcked

Asserts that the specified input element (of type checkbox or radio) is checked or not.

expect(dom)->ExpectDom.toBeChecked

0.1.18

2 months ago

0.1.17

1 year ago

0.1.16

1 year ago

0.1.15

1 year ago

0.1.12

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago