playwright/types
Dmitry Gozman d22dd4a4e7
feat(test runner): improve fixture typings for function fixtures (#9138)
When fixture value `R` is a function, TypeScript sometimes confuses
function `R` and function `async ({}, use) => {}`. This leads to
`any` types in the latter because it could be either of the functions
as TS thinks.

The solution is to only accept the second syntax, assuming that noone
passes fixture value that is a function as is:

```js
// This will stop working.
test.extend<{ foo: (x: number) => number }>({
  foo: x => 2 * x,
});

// This will get inferred types and autocomplete.
test.extend<{ foo: (x: number) => number }>({
  foo: async ({}, use) => {
    await use(x => 2 * x);
  },
});
```
2021-09-24 19:59:30 -07:00
..
protocol.d.ts feat(chromium): roll to 924544 (#9131) 2021-09-24 18:13:12 +02:00
structs.d.ts fix: make Serializable type any (#9059) 2021-09-23 11:06:34 -07:00
test.d.ts feat(test runner): improve fixture typings for function fixtures (#9138) 2021-09-24 19:59:30 -07:00
testExpect.d.ts Update testExpect.d.ts (#8923) 2021-09-14 12:40:17 -07:00
testReporter.d.ts docs: an overview of reporter methods (#8948) 2021-09-15 15:29:06 -07:00
types.d.ts fix: make Serializable type any (#9059) 2021-09-23 11:06:34 -07:00