-
-
Notifications
You must be signed in to change notification settings - Fork 258
Fix source location for JSXEmptyExpression nodes (fixes #248) #249
Conversation
👋 @jlongster - can you also add a fixture test for this? |
Sure, need to learn how to add a test first so will take me a bit. |
@jlongster All of the tests in Babylon just have fixtures that match a source string to the serialized AST. Basic steps are:
It also looks like you'll need to regenerate the results for |
We can add this steps in CONTRIBUTING like I did in Babel via https://github.com/babel/babel/blob/master/CONTRIBUTING.md#writing-tests |
@hzoo The current tests seem to be failing:
This is on the latest master without my changes. I see this failure in my CI too. I suppose I can fix it along with my PR, but is that expected? I don't see that failure in other PRs, but I don't understand why I can reproduce it by checking out master without my changes. |
@jlongster It's not super well documented (or at all?), but the tests right now actually run against the artifact spit out by Rollup. We have some clean up to do there. For the time being, try running Regarding the current tests failing in CI, haven't looked deep into it yet, but my suspicion is that your fix addressed an issue that we didn't notice when that fixture was last checked in. If you verify the AST in Edit: Yeah, the fixture checked in had some issues. Empty object for Thanks for contributing, btw! |
That makes sense, I figured it was something like that! No worries, keeping docs up-to-date and making these kinds of things takes a huge amount of time so I don't really mind figuring some things out. |
Done! |
Nice catch, thanks. |
Any chance this could be merged? |
👍 thanks @jlongster |
Turned out this is an easy fix. Looks like it wasn't appropriately using
this.state
as it should. See #248.