-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Property 'toBeWithinRange' does not exist on type 'Matchers<void>' #87
Comments
Hello @lihaibh, thank you for opening this issue. There is an open pull request at #62 (comment) which explains the current status of TypeScript support, unfortunately at the moment it needs improvement. |
This should hopefully be address in 3.8.3. |
@JoshuaKGoldberg @JamieMason it still doesnt work, on version: 3.8.3. Also when i add the line at the top of my spec file: import JasmineExpect from 'jasmine-expect'; I receive the error: [ts] File '..../node_modules/jasmine-expect/jasmine-matchers.d.ts' is not a module. so i removed it, but it still doesnt work.. |
I am converting to Jest from Karma and I moved the import statement to my setup-jest.ts and changed it to:
And my tests are running, no complaints in my IDE (Atom). Even if you aren't willing to convert to Jest you might try just changing the import statement to just |
I can confirm that adding the line
to the test file does work in Angular 5 with TypeScript. |
Thanks all, in the meantime I am working on a working example at https://github.com/JamieMason/Jasmine-Matchers/tree/dev/examples/jasmine-typescript. I'm not ready to merge it yet but it works. Thanks. |
I think this can be closed 🤞 The Jasmine with TypeScript example is working:
|
Ive installed jasmine-expect library in my nodejs application, im using Jest my ide displays an error:
Property 'toBeWithinRange' does not exist on type 'Matchers<void>'
and when i run my test suit itself i get an error:TypeError: expect(...).toBeWithinRange is not a function
Ive installed jasmine-expect and types/jasmine-expect.
My test suits are writen in Typescript, the testing framework im using is Jest, i followed the guide from your Readme.md and it still doesnt work:
configured package.json with:
"jest": { "unmockedModulePathPatterns": [ "jasmine-expect" ] ... }
added to my tsconfig.json with:
"types": [ "node", "jasmine-expect", "jasmine" ], ...
The text was updated successfully, but these errors were encountered: