hirezio / auto-spies

Create automatic spies from classes
MIT License
181 stars 30 forks source link

Can't compile and run code that uses "resolveWith" function. #22

Closed elira closed 4 years ago

elira commented 4 years ago

Describe the bug VSCode does not recognize the resolveWith function mentioned in the docs:

To Reproduce Steps to reproduce the behavior:

  1. Try using the code in the Readme file:
    let storeSpy: Spy<Store>;
    storeSpy = createSpyFromClass(Store);
    storeSpy.selectSnapshot.and.resolveWith({});

    Expected behavior Code should compile and work

Screenshots image

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Using angular 9

shairez commented 4 years ago

Thanks for the report @elira !

2 questions -

  1. Which version of jasmine-auto-spies are you using?

  2. does selectSnapshot returns a promise or an Observable? (is it ngRx, akita or a custom store?)

elira commented 4 years ago

Thanks for your reply @shairez !

  1. "jasmine-auto-spies": "^5.4.0",
  2. selectSnapshot returns an object. Ayayay. Sorry. I'll close this. :)
shairez commented 4 years ago

Sure thing @elira and no problem!