Skip to content
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

[test-runner] Missing types for the expect library #7099

Closed
fbasso opened this issue Jun 14, 2021 · 2 comments · Fixed by #7100
Closed

[test-runner] Missing types for the expect library #7099

fbasso opened this issue Jun 14, 2021 · 2 comments · Fixed by #7100
Labels
feature-test-runner Playwright test specific issues

Comments

@fbasso
Copy link

fbasso commented Jun 14, 2021

Hi !

In vscode, the expect library imported from '@playwright/test' proposes only a few choices:

image

And using the available assertions displays an error. For example:

import { expect } from '@playwright/test';
expect(...).toBe(...)
// Property 'toBe' does not exist on type 'Matchers<string>'.ts(2339)
@mxschmitt
Copy link
Member

As a workaround for now setting esModuleInterop or allowSyntheticDefaultImports to true in your tsconfig.json under compilerOptions should fix it.

@mxschmitt mxschmitt added feature-test-runner Playwright test specific issues triaging labels Jun 14, 2021
@fbasso
Copy link
Author

fbasso commented Jun 14, 2021

It worked perfectly, thanks @mxschmitt !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-test-runner Playwright test specific issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants