JSPM

@endosama/rescript-jest-dom

0.1.18
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q46165F
  • License MIT

jest-dom bindings for Rescript

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@endosama/rescript-jest-dom) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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