-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Update 'babel-plugin-transform-async-generator-functions' tests #5343
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5343 +/- ##
==========================================
- Coverage 84.44% 84.43% -0.01%
==========================================
Files 204 204
Lines 9596 9599 +3
Branches 2694 2697 +3
==========================================
+ Hits 8103 8105 +2
- Misses 1006 1007 +1
Partials 487 487
Continue to review full report at Codecov.
|
@@ -22,5 +24,7 @@ var output = 0; | |||
return forEach(genAnswers(), function(val) { output += val.value }) | |||
.then(function () { | |||
assert.equal(output, 42); | |||
}) | |||
.catch(function (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we wanted to test .catch we need to throw an error in a separate test so that we can test both a .then and a .catch separately? I thought that it shouldn't work because I didn't implement that as mentioned in the issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I'll write separate test.
I didn't understand. what shouldn't work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it does work, I just don't think the logic I wrote in 5ea57d5 accounts for .catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Alxpy the original issue was asking to add support for failing an async test via rejected promise to fixture-test-runner
since @hzoo added support for returning a promise.
ref: original discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@existentialism thanks, it became clear. I'll work on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I remember about this task, I just still do not have enough time
2b9b1a6
to
f277f35
Compare
result && | ||
( | ||
typeof result.then === "function" || | ||
typeof result.catch === "function" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@existentialism I added separate test (with rejected promise), but new test works without this line (typeof result.catch === "function"
). I think this is because the Promise always have .then
.
Or have I still misunderstand the problem?
I added processing errors (
.catch()
) toasync-generator-exec
test.