playwright-expect is an assertion library designed for enhancing end-to-end testing with Playwright Test and Jest. Currently at version 0.1.2, it significantly extends the default `expect` API with a richer set of matchers compared to similar libraries like `expect-playwright`, aiming to provide a more comprehensive and robust testing experience. Key differentiators include an extensive collection of easy-to-use assertions, exhaustive failure messages with diff highlights, options for case-insensitive matching and trimming values before assertion, and the ability to automatically wait for expectations to succeed. It seamlessly integrates with both Playwright Test and Jest and ships with built-in TypeScript types for improved developer experience and autocompletion. The project maintains an active patch release cadence, focusing on stability and feature enhancements.
npm install playwright-expectVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to install playwright-expect, extend Playwright's `expect` object, and use various custom matchers with options like `ignoreCase`, `trim`, and `timeout` in a Playwright Test setup.
Ensure you are extending Jest's `expect` (if using Jest) or Playwright's `expect` (if using Playwright Test) with `expect.extend(matchers)` in your configuration file.
Upgrade to version 0.0.6 or newer to resolve type resolution issues. Ensure your `tsconfig.json` or `jsconfig.json` is correctly configured for module resolution.
Consult the API documentation for `playwright-expect` to understand the available matchers and their specific options, especially when migrating from other assertion libraries.
Ensure you have `import { expect } from '@playwright/test';` (or Jest equivalent) and `expect.extend(matchers);` in your Playwright configuration file or global setup.Verify `playwright-expect` is installed. If using an older version (pre-0.0.6), consider upgrading. Check your `tsconfig.json` for correct `moduleResolution` settings.
No dependency data recorded yet.