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

v2: Missing test for promise.reject(error) #43

Closed
AlfredJKwack opened this issue Nov 30, 2018 · 2 comments
Closed

v2: Missing test for promise.reject(error) #43

AlfredJKwack opened this issue Nov 30, 2018 · 2 comments

Comments

@AlfredJKwack
Copy link
Collaborator

Hi,

We need a test case for the promise being rejected.

The basic structure should follow something like the below. I'm also curious why the errorHandler source code returns a simple string and not an error object. What's the thinking on that?

const promise = new Promise((resolve, reject) => {
    reject(new Error("Something awful happened"));
});
promise.then((res) => {
    // This is never called
});
promise.catch((err) => {
    console.log('I get called:', err.message); // I get called: 'Something awful happened'
});

As always, looking for some insight here before I supply a pull request.

@briangonzalez
Copy link
Owner

Whoops. That's an oversight, and a test for the rejection case would be much welcomed :)

@AlfredJKwack
Copy link
Collaborator Author

Done.

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