microsoft / playwright-test

Build a cross-browser end-to-end test suite with Playwright.
https://playwright.dev
Apache License 2.0
777 stars 34 forks source link

typescript definitions #25

Closed JoelEinbinder closed 4 years ago

JoelEinbinder commented 4 years ago

Right now there is an @types/jest packages that adds definitions for it/describe/expect into the global scope. This doesn't work for us, because our it has a state as its first argument, instead of a doneCallback.

The unit mode and e2e mode require different types, because the state in e2e mode contains a page, whereas the state in unit mode does not.

Ideally these types wouldn't pollute your apps global scope. So you can only use it from within .spec.js files.

lencioni commented 4 years ago

Beyond not polluting the global scope, it would be great if the types were also able to be contained from of other non-playwright jest tests.