Definitelytyped: Jasmine 3 typings

Created on 15 Nov 2018  路  8Comments  路  Source: DefinitelyTyped/DefinitelyTyped

  • [x] I tried using the @types/xxxx package and had problems.
  • [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [ ] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [x] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see Definitions by: in index.d.ts) so they can respond.

    • Authors: @borisyankov @theodorejb @davidparsson @gmoothart @lukas-zech-software @Engineer2B @cyungmann

We need to implement the new typings for Jasmine (version 3.x).

For example, new features like spyOnAllFunctions (https://github.com/jasmine/jasmine/pull/1581) are not available in the current typings.

Most helpful comment

@pe8ter It seems that return type of spyOnAllFunctions is wrong. Shouldn't it be declare function spyOnAllFunctions<T>(object: T): jasmine.SpyObj<T>;?

All 8 comments

Some are already in, https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30261 just got merged, and after https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30366 goes in I was planning on following up with a PR to add the async matchers. I'll scan the docs to see about spyOnAllFunctions and if there are any other missing features.

I didn't try too hard to find other functions, but I did add spyOnAllFunctions, expectAsync and all async matchers: See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30646.

Hi @pe8ter,
could you please add definitions for .withArgs() method on the Spy object as well.
It has been added on v3 and I'm apparently not the only one who needs this.
The referenced issue has no comments since 7th September.

Thank you very much! :+1:

@janriemer I think there is an issue with the Jasmine typings in that space and it will take some time to unravel. I will take a look at withArgs, but as part of a separate PR.

@janriemer Someone opened https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30872 with typings for withArgs.

@pe8ter Thank you very much for letting me now! This is great! :heart:

@pe8ter It seems that return type of spyOnAllFunctions is wrong. Shouldn't it be declare function spyOnAllFunctions<T>(object: T): jasmine.SpyObj<T>;?

Was this page helpful?
0 / 5 - 0 ratings