JSPM

  • Created
  • Published
  • Downloads 1979516
  • Score
    100M100P100Q202232F
  • License MIT

ESLint plugin for Playwright testing.

Package Exports

  • eslint-plugin-playwright

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 (eslint-plugin-playwright) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ESLint Plugin Playwright

Test NPM

ESLint plugin for your Playwright testing needs.

Installation

Yarn

yarn add -D eslint-plugin-playwright

NPM

npm install -D eslint-plugin-playwright

Usage

This plugin bundles two configurations to work with both @playwright/test or jest-playwright.

With Playwright test runner

{
  "extends": ["plugin:playwright/playwright-test"]
}

With Jest Playwright

{
  "extends": ["plugin:playwright/jest-playwright"]
}

Rules

missing-playwright-await 🔧

Enforce Playwright expect statements to be awaited.

Example

Example of incorrect code for this rule:

expect(page).toMatchText("text");

Example of correct code for this rule:

await expect(page).toMatchText("text");

Options

The rule accepts a non-required option which can be used to specify custom matchers which this rule should also warn about. This is useful when creating your own async matchers.

{
  "playwright/missing-playwright-await": [
    "error",
    { "customMatchers": ["toBeCustomThing"] }
  ]
}