-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Account for SequenceExpression in the utils #101
Conversation
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.
Thanks! Let's add a test for this please :-)
*/ | ||
export default function extractValueFromSequenceExpression(value) { | ||
// eslint-disable-next-line global-require | ||
const getValue = require('./index.js').default; |
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.
const getValue = require('./index.js').default; | |
const getValue = require('./').default; |
(i realize there's other files that include the redundant "index.js" but let's not continue the mistake)
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.
Yarn test gave me this error:
" 11:28 error Useless path segments for "./", should be "." import/no-useless-path-segments"
So ended up with: const getValue = require('.').default;
Thanks !!! I don't have much experience on this :) . What comes to mind is creating a new test file just for testing For example, playing with reactjs/react.dev#3120, I found out that, when running
|
Here's a test for OptionalCallExpression: jsx-ast-utils/__tests__/src/getPropValue-babelparser-test.js Lines 506 to 522 in f4752e6
|
The test is failing & I can't figure out why. But it turns out the test you used as example above, was also already failing with this msg:
To make sure it was already failing before I touched it, I cloned your repo again & run |
I deleted previous test & created a new one in tests/src/getPropValue-flowparser-test.js and now it passed. The previous test was failing because of the babel parser. So I think now is in the right place. Keep in mind that other 2 tests are failing, but those were failing before I touched the project. |
My apologies. Didn't realize had to do this small suggested change to the import. Please let me know if there's anything else I should do. Thanks |
looks like tests are failing :-/ |
Yes. As I explained in previous comment, those test were failing before I touched to repo. Maybe there's something I'm missing.
The tests failing are for file |
ahh ok gotcha, i'll see if i can fix that up. |
Do you think is a good idea to merge this one & then I can try to do some research about the other failing tests ? I spent some time looking at the code & maybe found the problem with this test. The name implies a test for an expression of type In I don't know the difference between
Or maybe previously both were MemberExpression, & now they are divided ?. But you if guide me in the right direction, I can do it. |
Filed #102 to fix master. |
Fix for #95.
The prop value with an expression type of SequenceExpression could not be resolved.