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
toBeInstanceOf(String)
not work
#3257
Comments
You can test types like this: expect(typeof expected).toBe('string') |
Would anyone be interested in having a discussion around this? It seems like a bit of a trip up that this doesn't work when using Perhaps a way forward is implementing other functions for the primative types, such as |
@eedrah I'd recommend taking a look at https://github.com/jest-community/jest-extended |
FYI: jest-extended typescript declaration doesn't work when executing $ tsc --pretty -p . --noemit
test/edge.test.ts:6:34 - error TS2339: Property 'toBeString' does not exist on type 'Matchers<any>'.
6 expect(bundled_module()).toBeString();
~~~~~~~~~~ 😞 |
You can open up an issue in that repo. I can see the type definition there, so it'll probably be fixed if there's an error 🙂 |
How about this: expect("").toMatch(/.*/) |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The following expectation doesn't work as expected.
Test output:
I did not find any docs or issue about this. How do I test whether a value is a String type?
The text was updated successfully, but these errors were encountered: