testing-library / pptr-testing-library

puppeteer + dom-testing-library = 💖
MIT License
287 stars 29 forks source link

Typescript: can't use heading levels #61

Closed Hypnosphi closed 3 years ago

Hypnosphi commented 3 years ago
getByRole(document, 'heading', {level: 1})

gives following error:

TS2345: Argument of type '{ level: number; }' is not assignable to parameter of type 'RoleMatcherOptions'.   Object literal may only specify known properties, and 'level' does not exist in type 'RoleMatcherOptions'

You may want to reuse ByRoleOptions

patrickhulce commented 3 years ago

thanks @Hypnosphi! PR welcome if anyone would like to contribute :)