playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG]: TypeScript error with using test.extend

Open BlackySoul opened this issue 1 year ago • 0 comments

System info

  • Playwright Version: 1.41.1
  • Operating System: macOS 13.5.1
  • Browser: -
  • Other info:

Source code

Hi! I'm trying to use test.extend in the following way:

import { test as base } from "@playwright/experimental-ct-react";

export type Options = { defaultItem: string };

// Extend basic test by providing a "defaultItem" option and a "todoPage" fixture.
export const test = base.extend<Options>({
  // Define an option and provide a default value.
  // We can later override it in the config.
  defaultItem: ["Do stuff", { option: true }],
});

However, I'm receiving a TypeScript error:

image

Here's the repo: https://github.com/BlackySoul/playwright-test

Steps

  • Clone the repo
  • Execute the folowwing commands:
    • cd playwright-test
    • npm install
    • lint:types

Expected

No error present

Actual

image
  • related #29070

BlackySoul avatar Jan 22 '24 11:01 BlackySoul