GithubHelp home page GithubHelp logo

Comments (5)

shairez avatar shairez commented on June 7, 2024

Thanks @petrzjunior

Personally I favor less nested calls and one-liners, but that's just my style

But I don't see an issue adding this line of code

If you can, please open a PR with tests, and I'll approve it

Thanks!

from observer-spy.

github-actions avatar github-actions commented on June 7, 2024

🎉 This issue has been resolved in version 2.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

from observer-spy.

shairez avatar shairez commented on June 7, 2024

@petrzjunior
OK I changed (locally) the test you wrote to reflect your needs -

it('should allow single line style for expectErrors', () => {
   expect(subscribeSpyTo(throwError(() => FAKE_ERROR_MESSAGE)).expectErrors().getError()).toEqual(FAKE_ERROR_MESSAGE); 
})

And it doesn't really work... because the expectErrors need to be defind before the Observable is subscribed to... so it will probably only work in cases there is an actual delay between values (which you wouldn't want to "wait for real" for those as this will make your tests slower...)

That's why you configure expectErrors: true when calling subscribeSpyTo and not after

So unless I'm missing something, I don't think this change will allow you to do what you need to do

from observer-spy.

petrzjunior avatar petrzjunior commented on June 7, 2024

@shairez I'm afraid you are correct here. My actual use case is similar to what you wrote and it does not work as I expected, since the value is emitted in the same tick. I'm guessing the change is not that useful then, sorry.

from observer-spy.

shairez avatar shairez commented on June 7, 2024

No worries my friend, I completely missed that one as well
We can't learn if we don't try... :)

Thanks for the contribution!

from observer-spy.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.