Did you resolve the right line? #2
HelgeStenstrom
started this conversation in
General
Replies: 1 comment
-
Hey! Yep, you are right! I don't remember why I resolved the test in that way. The test definition is: it('returns a new promise', () => {
const whatToReturn = () => Promise.reject();
const promise = Promise.reject();
return promise.catch(() =>
whatToReturn()
);
}); So, it makes more sense to write Thanks for you comment! 🙂 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
jskatas/src/promise/079-catch/solution.js
Lines 35 to 36 in d272bbb
Hi!
I'm new to Javascript, and found this repo to be helpful to see if I'm on the right track on the katas.
On the two marked lines, I would have used resolve() on the first line, the whatToReturn, line 35 instead of line 36.
Am I right or wrong?
Both variants make the test pass.
Beta Was this translation helpful? Give feedback.
All reactions