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

coverage analysis modifies a function return #856

danielo515 opened this issue Aug 31, 2018 · 0 comments

coverage analysis modifies a function return #856

danielo515 opened this issue Aug 31, 2018 · 0 comments


Copy link

@danielo515 danielo515 commented Aug 31, 2018

This issue affects both lab14 and lab16 (didn't tried 15).

The problems is that code analysis is, in some way modifying the returning value of a function. It is a very simple function like this:

const trace = (msg) => (x) => (, x), x);

When I run the test without code coverage it works as expected. When I run the test with code coverage activated then the return value of the function is undefined.
I'm using this function on a promise chain and the following function in the chain is destructuring the result value of the previous function and of course it is failing because it can not destructure undefined.

Here is a fully working GIST that you can use as playground:

There is a branch called lab16 where you can test with lab 16

I'm very sure that the problem is code coverage of this function because if wrap the function between coverage on and off then everything works as expected and test passes:

// This is a simple but valid function
/* $lab:coverage:off$ */
const trace = (msg) => (x) => (, x), x);
/* $lab:coverage:on$ */

Thanks and regards

@geek geek added the bug label Nov 10, 2018
@hueniverse hueniverse self-assigned this Sep 22, 2019
@hueniverse hueniverse added this to the 20.2.3 milestone Sep 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.