Typescript mismatch with toBeTrue/toBeFalse as of @types/jasmine 3.5.0
See original GitHub issueDescription
When using recent jasmine-expect 4.0.3 with @types/jasmine 3.5.0 we get the following errors:
TypeScript error: node_modules/jasmine-expect/dist/toBeFalse.d.ts(5,13): Error TS2717: Subsequent property declarations must have the same type. Property 'toBeFalse' must be of type '() => boolean', but here has type 'ToBeFalse'.
TypeScript error: node_modules/jasmine-expect/dist/toBeTrue.d.ts(5,13): Error TS2717: Subsequent property declarations must have the same type. Property 'toBeTrue' must be of type '() => boolean', but here has type 'ToBeTrue'.
Suggested Solution
This seems to be due this commit https://github.com/DefinitelyTyped/DefinitelyTyped/commit/c0e76f846ea10b34f3a22a49d33cfa879ea8c0ba
Using @types/jasmine 3.4.6 for now
Help Needed
Not sure who got it right: jasmine-expect or @types/jasmine
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:6
Top Results From Across the Web
Typescript mismatch with toBeTrue/toBeFalse as of @types ...
When using recent jasmine-expect 4.0.3 with @types/jasmine 3.5.0 we get the following errors: TypeScript error: node_modules/jasmine-expect/dist ...
Read more >Jasmine errors after upgrading to Angular 8 - Stack Overflow
When I run ng test --source-map false I get the following error. What can I do to fix it? ERROR in node_modules/@types/jasmine/index.d.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
jasmine 3.5 now has it’s own
toBeTrue
andtoBeFalse
matchers, so they could just be removed from this library.@JamieMason Would you be willing to accept a PR to remove
expectationFailOutput?: any
parameter from.toBeTrue()
and.toBeFalse()
matchers to prevent conflict with built-in matchers with the same name available as of Jasmine 3.5.0? This will require a major release as it is a breaking change.Not suggesting complete removal of the matchers as Jest does not have them and also because it will affect more people then removal of the optional parameter.
For Jasmine
expectationFailOutput
works because of an implementation detail and is not a supported usage. That’s why Jasmine 3.3.0 introduced.withContext()
as supported way to add more information to the assertion.Not sure how does this influence Jest users of the library though.
PS I will also try to deprecated
expectationFailOutput
parameters in@types/jasmine
package in the coming weeks. If that goes through it should be a good idea to deprecate this parameter in alljasmine-expect
matchers, so people would migrate from the unsupported usage.