Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@types/testing-library__jest-dom
Advanced tools
Stub TypeScript definitions entry for @testing-library/jest-dom, which provides its own types definitions
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.
This is a stub types definition for @types/testing-library__jest-dom (https://github.com/testing-library/jest-dom#readme).
@testing-library/jest-dom provides its own type definitions, so you don't need @types/testing-library__jest-dom installed!
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,094,743 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.