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

Update 'babel-plugin-transform-async-generator-functions' tests #5343

Closed

Conversation

oleksandr-kuzmenko
Copy link
Contributor

Q A
Patch: Bug Fix? no
Major: Breaking Change? no
Minor: New Feature? no
Deprecations? no
Spec Compliancy? yes
Tests Added/Pass? yes
Fixed Tickets Closes #4583
License MIT
Doc PR
Dependency Changes no

I added processing errors (.catch()) to async-generator-exec test.

@codecov-io
Copy link

codecov-io commented Feb 19, 2017

Codecov Report

Merging #5343 into master will decrease coverage by <.01%.
The diff coverage is 75%.

@@            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
Impacted Files Coverage Δ
...-helper-transform-fixture-test-runner/src/index.js 82.95% <75%> (-0.58%)
...bel-plugin-transform-es2015-classes/src/vanilla.js 89.74% <0%> (-0.43%)
packages/babel-traverse/src/visitors.js 86.66% <0%> (+0.95%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea787a1...f277f35. Read the comment docs.

@@ -22,5 +24,7 @@ var output = 0;
return forEach(genAnswers(), function(val) { output += val.value })
.then(function () {
assert.equal(output, 42);
})
.catch(function (error) {
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

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

Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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

@hzoo hzoo added the WIP label Feb 21, 2017
result &&
(
typeof result.then === "function" ||
typeof result.catch === "function"
Copy link
Contributor Author

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?

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow async exec test to reject
4 participants