Skip to content
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

Wrong resolvers condition when or(true, false) and final resolver throws #46

Open
newsiberian opened this issue Nov 23, 2018 · 1 comment

Comments

@newsiberian
Copy link

newsiberian commented Nov 23, 2018

Hi, funny thing. Not all cases are covered in tests and there is a bug with one of these.
Here is an example of test with or condition:

// test/unit/helper_spec.js
it('when (true, false) and resolver throws, it should return exactly that error', () => {
        const resolver = or(successResolver, failureResolver);
        const testError = new Error('test');
        const finalResolver = resolver(() => {
          throw testError;
        });
        return finalResolver()
          .catch(err => {
            expect(err).to.equal(testError);
          });
      });

So, if first resolver succeed it immediately runs query. But if query throws, second resolver runs after that and if it is throws, we receive that second error, but not the error that query throws

@klymenko-serhii
Copy link

Just meet same issue few hours ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants