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

Promise.all only accepts promises as parameters #32

Open
davidje13 opened this issue Feb 18, 2019 · 1 comment
Open

Promise.all only accepts promises as parameters #32

davidje13 opened this issue Feb 18, 2019 · 1 comment

Comments

@davidje13
Copy link

While debugging an issue in another project, I found that this mocking library doesn't conform to the spec for Promise.all

Specifically, Promise.all should be able to accept a mix of promises and non-promises, but https://github.com/charleshansen/mock-promises/blob/master/lib/mock-promises.js#L245 expects only promises.

Essentially:

const a = Promise.resolve('foo');
const b = 'bar';
const c = null;

Promise.all([a, b, c]).then(console.log);

Should print foo, bar, null. But currently it produces the error:

TypeError: promise.then is not a function

@charleshansen
Copy link
Owner

True story. I'm not 100% sure there even was a Promise.all spec when I wrote this. I don't know when I will have time to fix it, but I don't think it should be too bad. I'd gladly take a PR :)

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