Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@types/testing-library__jest-dom
Advanced tools
The @types/testing-library__jest-dom package provides TypeScript type definitions for the jest-dom library, which extends Jest's default matchers to provide more expressive assertions for DOM nodes. This allows developers to write more readable and maintainable tests when using Jest with the DOM or React components.
toBeVisible
Checks if an element is visible to the user. This means that the element is not only displayed (i.e., it does not have a CSS display value of 'none'), but also has a non-zero size and is not hidden by other elements.
expect(element).toBeVisible();
toHaveTextContent
Asserts that a given DOM element has text content that matches the expected text, which can be a string or a regular expression.
expect(element).toHaveTextContent('text');
toHaveAttribute
Ensures that a DOM element has an attribute with a specific value. This is useful for checking if elements have the correct attributes set, such as links with the correct href values.
expect(element).toHaveAttribute('href', 'https://example.com');
toHaveClass
Verifies that a DOM element has a particular class or classes. This matcher can take a single class name as a string, or an array of class names to check for multiple classes.
expect(element).toHaveClass('class-name');
toBeChecked
Asserts that an input element of type checkbox or radio is checked. This is useful for ensuring that form elements are in the expected state in response to user interactions or initial conditions.
expect(checkbox).toBeChecked();
chai-dom is a plugin for the Chai assertion library that provides a set of assertions similar to jest-dom, but for use with Chai. It allows developers to make assertions about the DOM when using Mocha or other testing frameworks that support Chai.
expect-puppeteer is a set of custom matchers for Jest to test with Puppeteer. While it focuses on interactions with a headless browser and is more end-to-end oriented, it provides similar functionalities in terms of asserting DOM states and content.
jasmine-dom offers DOM-specific matchers for the Jasmine testing framework, similar to what jest-dom provides for Jest. It allows developers using Jasmine to write more expressive assertions about the DOM.
npm install --save @types/testing-library__jest-dom
This package contains type definitions for @testing-library/jest-dom (https://github.com/testing-library/jest-dom).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__jest-dom.
These definitions were written by Ernesto García, John Gozde, Seth Macpherson, and Andrew Leedham.
FAQs
Stub TypeScript definitions entry for @testing-library/jest-dom, which provides its own types definitions
The npm package @types/testing-library__jest-dom receives a total of 4,345,238 weekly downloads. As such, @types/testing-library__jest-dom popularity was classified as popular.
We found that @types/testing-library__jest-dom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.