Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

Typescript Error: findAllByTestId #35

Closed
AlexandreMPDias opened this issue Jun 19, 2019 · 3 comments
Closed

Typescript Error: findAllByTestId #35

AlexandreMPDias opened this issue Jun 19, 2019 · 3 comments
Labels

Comments

@AlexandreMPDias
Copy link

AlexandreMPDias commented Jun 19, 2019

Relevant code or config:

	it('should render the typed password', () => {
		let login = render(<Login />);
		const emailField = login.findAllByTestId('login_email');
	//TODO
	});

What happened:

I get a typescript error saying: "login_email" is not compatible with type 'MatcherOptions | undefined'.

Issue

I read the source code... and the example in the documentations, and I think that the right type for this function's argument should be Match, as declared in matches.d.ts

Workaround

If I write 'login_email' as any, it works normally

@bcarroll22
Copy link
Collaborator

I believe this is related to #32

I don't use TypeScript personally or in any projects I work on, so I pretty much rely on folks who use this library and TypeScript to make sure that the typings work and are as accurate as possible. I'd appreciate any contributions you make to improving them! 😄

@AlexandreMPDias
Copy link
Author

Ohh, I do think those are related... I specified "getByTestId" because I starting using this library yesterday and I had only used that function so far hahahah

@bcarroll22
Copy link
Collaborator

🎉 This issue has been resolved in version 4.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants