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

Multiline Danger Imports/Requires Fixes #829 #830

Merged
merged 3 commits into from
Feb 15, 2019

Conversation

fbartho
Copy link
Member

@fbartho fbartho commented Feb 15, 2019

In #829 I found a case where prettier would break my danger file by forcing my import onto two lines.

I fiddled with the regexes that were nuking the danger-imports and added more test cases to the test suite.

I'm no expert at Regex -- please feel free to improve their efficiency / clarity!

Additionally, this attempts to preserve the original source code, with the hope that DangerJS Error messages will appear on the correct "original source" lines. (I admit to doing nothing to verify this).

Finally, this PR changes this test from manually coded result-strings to Jest's new-ish toMatchInlineSnapshot API.

@fbartho fbartho requested a review from orta February 15, 2019 01:20
@orta
Copy link
Member

orta commented Feb 15, 2019

Great tests, yeah, this makes senes

@orta orta merged commit 98b86e1 into master Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants