-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Types resolution fails for expect-puppeteer matchers #598
Comments
Fixed in #599 |
This error happens if you're trying to call toMatchElement() with an argument that's not a Page | Frame | ElementHandle, which is strange because typescript flags it as a Page in your screenshot. Maybe there's a conflict with another jest based library ? It would be great if I could clone a repo where the error occurs to see if I can reproduce it and investigate. Also, double check that you've done everything as regards to the troubleshooting section. |
@jamesgpearce I created a pull request in your repo to fix that 👍 maybe I'll update the docs here to be more explicit about the imports thing since |
🐛 Bug Report
When writing tests with Typescript, the types resolution fails in the VSCode IDE (and maybe other code editors as well) for the
jest-puppeteer
globals :expect
browser
context
page
puppeteerConfig
jestPuppeteer
To Reproduce
Steps to reproduce the behavior:
jest-puppeteer
README.*.test.ts
file and write some basic tests involvingjest-puppeteer
globals.expect-puppeteer
matchers as nonexistent.expect-puppeteer
matchers are nevertheless still flagged as nonexistent by Typescript.Expected behavior
Types resolution should work, globals and
expect-puppeteer
matchers should be available in the IDE for autocompletion and autocorrect.Link to repl or repo (highly encouraged)
Repo here
Run
npx envinfo --system --binaries --npmPackages expect-puppeteer,jest-dev-server,jest-environment-puppeteer,jest-puppeteer,spawnd --markdown --clipboard
Paste the results here:
The text was updated successfully, but these errors were encountered: