You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect that the code-rewriting that NYC does will not interfere with expected language behavior, specifically the name inference that occurs when an anonymous arrow function is assigned via a "default parameter value" in a function definition:
If you clone the linked bug demo repo, and run the tests normally (node test.js), it works fine, because the name inference works. But then when you run the same tests via NYC, the tests fail.
NYC rewrites the code in a way that loses this "fn" name inference, such that the value is "" instead (because it's an anonymous function). My test relies on that proper name inference, as it's a standard part of the JS language behavior.
Troubleshooting steps
[ X ] still occurring when I put cache: false in my nyc config
Link to bug demonstration repository
nyc-bug-demo
Expected Behavior
I expect that the code-rewriting that NYC does will not interfere with expected language behavior, specifically the name inference that occurs when an anonymous arrow function is assigned via a "default parameter value" in a function definition:
Observed Behavior
If you clone the linked bug demo repo, and run the tests normally (
node test.js
), it works fine, because the name inference works. But then when you run the same tests via NYC, the tests fail.NYC rewrites the code in a way that loses this
"fn"
name inference, such that the value is""
instead (because it's an anonymous function). My test relies on that proper name inference, as it's a standard part of the JS language behavior.Troubleshooting steps
cache: false
in my nyc configEnvironment Information
The text was updated successfully, but these errors were encountered: